******************************************************************
BEGIN PROOF: tSPL -> SPL
------------------------------------------------------------------
tSPL expression:
------------------------------------------------------------------
TLess(TEvalPolynomial(2, D), TDistance(TInfinityNorm(2)))
******************************************************************

==================================================================
EXPANSION RULE: TEvalPolynomial_Base
------------------------------------------------------------------
original expression:
------------------------------------------------------------------
TEvalPolynomial(2, D)
------------------------------------------------------------------
substituted expression:
------------------------------------------------------------------
ScalarProd(3, D) o 
Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0))


==================================================================
EXPANSION RULE: TInfinityNorm_Base
------------------------------------------------------------------
original expression:
------------------------------------------------------------------
TInfinityNorm(2)
------------------------------------------------------------------
substituted expression:
------------------------------------------------------------------
Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
PointWise(2, Lambda([ r11, i13 ], abs(r11)))


==================================================================
EXPANSION RULE: TDistance_Base
------------------------------------------------------------------
original expression:
------------------------------------------------------------------
TDistance(TInfinityNorm(2))

------------------------------------------------------------------
subtree substitutions: 
------------------------------------------------------------------
TInfinityNorm_Base( TInfinityNorm(2) )


------------------------------------------------------------------
subtrees substituted: 
------------------------------------------------------------------
TDistance(Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
  PointWise(2, Lambda([ r11, i13 ], abs(r11))))
------------------------------------------------------------------
substituted expression:
------------------------------------------------------------------
Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
BinOp(2, Lambda([ r12, r13 ], sub(r12, r13)))


==================================================================
EXPANSION RULE: TLess_Base
------------------------------------------------------------------
original expression:
------------------------------------------------------------------
TLess(TEvalPolynomial(2, D), TDistance(TInfinityNorm(2)))

------------------------------------------------------------------
subtree substitutions: 
------------------------------------------------------------------
TEvalPolynomial_Base( TEvalPolynomial(2, D) )

TDistance_Base( TDistance(TInfinityNorm(2)),
  TInfinityNorm_Base( TInfinityNorm(2) ) )


------------------------------------------------------------------
subtrees substituted: 
------------------------------------------------------------------
TLess(ScalarProd(3, D) o 
  Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)), Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
  PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
  BinOp(2, Lambda([ r12, r13 ], sub(r12, r13))))
------------------------------------------------------------------
substituted expression:
------------------------------------------------------------------
BinOp(1, Lambda([ r14, r15 ], geq(r15, r14))) o 
DirectSum(
  ScalarProd(3, D) o 
  Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)), 
  Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
  PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
  BinOp(2, Lambda([ r12, r13 ], sub(r12, r13)))
)


******************************************************************
END PROOF: tSPL -> SPL
------------------------------------------------------------------
SPL expression:
------------------------------------------------------------------
BinOp(1, Lambda([ r14, r15 ], geq(r15, r14))) o 
DirectSum(
  ScalarProd(3, D) o 
  Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)), 
  Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
  PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
  BinOp(2, Lambda([ r12, r13 ], sub(r12, r13)))
)******************************************************************

******************************************************************
BEGIN PROOF: SPL -> Sigma-SPL
------------------------------------------------------------------
SPL expression:
------------------------------------------------------------------
BinOp(1, Lambda([ r14, r15 ], geq(r15, r14))) o 
DirectSum(
  ScalarProd(3, D) o 
  Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)), 
  Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
  PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
  BinOp(2, Lambda([ r12, r13 ], sub(r12, r13)))
)
******************************************************************

==================================================================
EXPANSION RULE: BinOp
------------------------------------------------------------------
SPL expression:
------------------------------------------------------------------
BinOp(1, Lambda([ r14, r15 ], geq(r15, r14)))
------------------------------------------------------------------
Sigma-SPL expression:
------------------------------------------------------------------
BinOp(1, Lambda([ r14, r15 ], geq(r15, r14)))


==================================================================
EXPANSION RULE: ScalarProd
------------------------------------------------------------------
SPL expression:
------------------------------------------------------------------
ScalarProd(3, D)
------------------------------------------------------------------
Sigma-SPL expression:
------------------------------------------------------------------
Reduction(3, (a, b) -> add(a, b), V(0.0), (arg) -> false) o 
PointWise(3, Lambda([ r16, i14 ], mul(r16, nth(D, i14))))


==================================================================
EXPANSION RULE: Induction
------------------------------------------------------------------
SPL expression:
------------------------------------------------------------------
Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0))
------------------------------------------------------------------
Sigma-SPL expression:
------------------------------------------------------------------
Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0))


==================================================================
EXPANSION RULE: OLCompose
------------------------------------------------------------------
SPL expression:
------------------------------------------------------------------
ScalarProd(3, D) o 
Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0))
------------------------------------------------------------------
Sigma-SPL expression:
------------------------------------------------------------------
Reduction(3, (a, b) -> add(a, b), V(0.0), (arg) -> false) o 
PointWise(3, Lambda([ r16, i14 ], mul(r16, nth(D, i14)))) o 
Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0))


==================================================================
EXPANSION RULE: Reduction
------------------------------------------------------------------
SPL expression:
------------------------------------------------------------------
Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false)
------------------------------------------------------------------
Sigma-SPL expression:
------------------------------------------------------------------
Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false)


==================================================================
EXPANSION RULE: PointWise
------------------------------------------------------------------
SPL expression:
------------------------------------------------------------------
PointWise(2, Lambda([ r11, i13 ], abs(r11)))
------------------------------------------------------------------
Sigma-SPL expression:
------------------------------------------------------------------
PointWise(2, Lambda([ r11, i13 ], abs(r11)))


==================================================================
EXPANSION RULE: OLCompose
------------------------------------------------------------------
SPL expression:
------------------------------------------------------------------
Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
PointWise(2, Lambda([ r11, i13 ], abs(r11)))
------------------------------------------------------------------
Sigma-SPL expression:
------------------------------------------------------------------
Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
PointWise(2, Lambda([ r11, i13 ], abs(r11)))


==================================================================
EXPANSION RULE: BinOp
------------------------------------------------------------------
SPL expression:
------------------------------------------------------------------
BinOp(2, Lambda([ r12, r13 ], sub(r12, r13)))
------------------------------------------------------------------
Sigma-SPL expression:
------------------------------------------------------------------
ISumUnion(i15, 2,
  ScatHUnion(2, 1, i15, 1) o 
  BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
  GathH(4, 2, i15, 2)
)


==================================================================
EXPANSION RULE: OLCompose
------------------------------------------------------------------
SPL expression:
------------------------------------------------------------------
Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
BinOp(2, Lambda([ r12, r13 ], sub(r12, r13)))
------------------------------------------------------------------
Sigma-SPL expression:
------------------------------------------------------------------
Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
ISumUnion(i15, 2,
  ScatHUnion(2, 1, i15, 1) o 
  BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
  GathH(4, 2, i15, 2)
)


==================================================================
EXPANSION RULE: DirectSum
------------------------------------------------------------------
SPL expression:
------------------------------------------------------------------
DirectSum(
  ScalarProd(3, D) o 
  Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)), 
  Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
  PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
  BinOp(2, Lambda([ r12, r13 ], sub(r12, r13)))
)
------------------------------------------------------------------
Sigma-SPL expression:
------------------------------------------------------------------
SUMUnion(
  ScatHUnion(2, 1, 0, 1) o 
  Reduction(3, (a, b) -> add(a, b), V(0.0), (arg) -> false) o 
  PointWise(3, Lambda([ r16, i14 ], mul(r16, nth(D, i14)))) o 
  Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
  GathH(5, 1, 0, 1), 
  ScatHUnion(2, 1, 1, 1) o 
  Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
  PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
  ISumUnion(i15, 2,
    ScatHUnion(2, 1, i15, 1) o 
    BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
    GathH(4, 2, i15, 2)
  ) o 
  GathH(5, 4, 1, 1)
)


==================================================================
EXPANSION RULE: OLCompose
------------------------------------------------------------------
SPL expression:
------------------------------------------------------------------
BinOp(1, Lambda([ r14, r15 ], geq(r15, r14))) o 
DirectSum(
  ScalarProd(3, D) o 
  Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)), 
  Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
  PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
  BinOp(2, Lambda([ r12, r13 ], sub(r12, r13)))
)
------------------------------------------------------------------
Sigma-SPL expression:
------------------------------------------------------------------
BinOp(1, Lambda([ r14, r15 ], geq(r15, r14))) o 
SUMUnion(
  ScatHUnion(2, 1, 0, 1) o 
  Reduction(3, (a, b) -> add(a, b), V(0.0), (arg) -> false) o 
  PointWise(3, Lambda([ r16, i14 ], mul(r16, nth(D, i14)))) o 
  Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
  GathH(5, 1, 0, 1), 
  ScatHUnion(2, 1, 1, 1) o 
  Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
  PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
  ISumUnion(i15, 2,
    ScatHUnion(2, 1, i15, 1) o 
    BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
    GathH(4, 2, i15, 2)
  ) o 
  GathH(5, 4, 1, 1)
)


******************************************************************
END PROOF: SPL -> Sigma-SPL
------------------------------------------------------------------
Sigma-SPL expression:
------------------------------------------------------------------
BinOp(1, Lambda([ r14, r15 ], geq(r15, r14))) o 
SUMUnion(
  ScatHUnion(2, 1, 0, 1) o 
  Reduction(3, (a, b) -> add(a, b), V(0.0), (arg) -> false) o 
  PointWise(3, Lambda([ r16, i14 ], mul(r16, nth(D, i14)))) o 
  Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
  GathH(5, 1, 0, 1), 
  ScatHUnion(2, 1, 1, 1) o 
  Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
  PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
  ISumUnion(i15, 2,
    ScatHUnion(2, 1, i15, 1) o 
    BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
    GathH(4, 2, i15, 2)
  ) o 
  GathH(5, 4, 1, 1)
)
******************************************************************


******************************************************************
BEGIN PROOF: SigmaSPL -> SigmaSPL
------------------------------------------------------------------
Ruleset:RulesSumsHACMS
------------------------------------------------------------------
Initial SigmaSPL
------------------------------------------------------------------
BinOp(1, Lambda([ r14, r15 ], geq(r15, r14))) o 
SUMUnion(
  ScatHUnion(2, 1, 0, 1) o 
  Reduction(3, (a, b) -> add(a, b), V(0.0), (arg) -> false) o 
  PointWise(3, Lambda([ r16, i14 ], mul(r16, nth(D, i14)))) o 
  Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
  GathH(5, 1, 0, 1), 
  ScatHUnion(2, 1, 1, 1) o 
  Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
  PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
  ISumUnion(i15, 2,
    ScatHUnion(2, 1, i15, 1) o 
    BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
    GathH(4, 2, i15, 2)
  ) o 
  GathH(5, 4, 1, 1)
)
******************************************************************

------------------------------------------------------------------
RULE: OLCompose_Assoc
------------------------------------------------------------------
old expression
------------------------------------------------------------------
ScatHUnion(2, 1, 0, 1) o 
Reduction(3, (a, b) -> add(a, b), V(0.0), (arg) -> false) o 
PointWise(3, Lambda([ r16, i14 ], mul(r16, nth(D, i14)))) o 
Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
GathH(5, 1, 0, 1)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
ScatHUnion(2, 1, 0, 1) o 
Reduction(3, (a, b) -> add(a, b), V(0.0), (arg) -> false) o 
PointWise(3, Lambda([ r16, i14 ], mul(r16, nth(D, i14)))) o 
Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
GathH(5, 1, 0, 1)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: OLCompose_Assoc
------------------------------------------------------------------
old expression
------------------------------------------------------------------
ScatHUnion(2, 1, 0, 1) o 
Reduction(3, (a, b) -> add(a, b), V(0.0), (arg) -> false) o 
PointWise(3, Lambda([ r16, i14 ], mul(r16, nth(D, i14)))) o 
Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
GathH(5, 1, 0, 1)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
ScatHUnion(2, 1, 0, 1) o 
Reduction(3, (a, b) -> add(a, b), V(0.0), (arg) -> false) o 
PointWise(3, Lambda([ r16, i14 ], mul(r16, nth(D, i14)))) o 
Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
GathH(5, 1, 0, 1)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: OLCompose_Assoc
------------------------------------------------------------------
old expression
------------------------------------------------------------------
ScatHUnion(2, 1, 1, 1) o 
Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
ISumUnion(i15, 2,
  ScatHUnion(2, 1, i15, 1) o 
  BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
  GathH(4, 2, i15, 2)
) o 
GathH(5, 4, 1, 1)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
ScatHUnion(2, 1, 1, 1) o 
Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
ISumUnion(i15, 2,
  ScatHUnion(2, 1, i15, 1) o 
  BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
  GathH(4, 2, i15, 2)
) o 
GathH(5, 4, 1, 1)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: OLCompose_Assoc
------------------------------------------------------------------
old expression
------------------------------------------------------------------
ScatHUnion(2, 1, 1, 1) o 
Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
ISumUnion(i15, 2,
  ScatHUnion(2, 1, i15, 1) o 
  BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
  GathH(4, 2, i15, 2)
) o 
GathH(5, 4, 1, 1)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
ScatHUnion(2, 1, 1, 1) o 
Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
ISumUnion(i15, 2,
  ScatHUnion(2, 1, i15, 1) o 
  BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
  GathH(4, 2, i15, 2)
) o 
GathH(5, 4, 1, 1)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: PointWise_ISumUnion
------------------------------------------------------------------
old expression
------------------------------------------------------------------
ScatHUnion(2, 1, 1, 1) o 
Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
ISumUnion(i15, 2,
  ScatHUnion(2, 1, i15, 1) o 
  BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
  GathH(4, 2, i15, 2)
) o 
GathH(5, 4, 1, 1)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
ScatHUnion(2, 1, 1, 1) o 
Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
ISumUnion(i15, 2,
  PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
  ScatHUnion(2, 1, i15, 1) o 
  BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
  GathH(4, 2, i15, 2)
) o 
GathH(5, 4, 1, 1)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: Reduction_ISumReduction
------------------------------------------------------------------
old expression
------------------------------------------------------------------
ScatHUnion(2, 1, 1, 1) o 
Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
ISumUnion(i15, 2,
  PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
  ScatHUnion(2, 1, i15, 1) o 
  BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
  GathH(4, 2, i15, 2)
) o 
GathH(5, 4, 1, 1)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
ScatHUnion(2, 1, 1, 1) o 
ISumReduction(i15, 2, (a, b) -> max(a, b), V(0.0), (arg) -> false,
  Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
  PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
  ScatHUnion(2, 1, i15, 1) o 
  BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
  GathH(4, 2, i15, 2)
) o 
GathH(5, 4, 1, 1)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: ISumXXX_YYY
------------------------------------------------------------------
old expression
------------------------------------------------------------------
ScatHUnion(2, 1, 1, 1) o 
ISumReduction(i15, 2, (a, b) -> max(a, b), V(0.0), (arg) -> false,
  Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
  PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
  ScatHUnion(2, 1, i15, 1) o 
  BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
  GathH(4, 2, i15, 2)
) o 
GathH(5, 4, 1, 1)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
ScatHUnion(2, 1, 1, 1) o 
ISumReduction(i15, 2, (a, b) -> max(a, b), V(0.0), (arg) -> false,
  Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
  PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
  ScatHUnion(2, 1, i15, 1) o 
  BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
  GathH(4, 2, i15, 2) o 
  GathH(5, 4, 1, 1)
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: OLCompose_Assoc
------------------------------------------------------------------
old expression
------------------------------------------------------------------
Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
ScatHUnion(2, 1, i15, 1) o 
BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
GathH(4, 2, i15, 2) o 
GathH(5, 4, 1, 1)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
ScatHUnion(2, 1, i15, 1) o 
BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
GathH(4, 2, i15, 2) o 
GathH(5, 4, 1, 1)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: OLCompose_Assoc
------------------------------------------------------------------
old expression
------------------------------------------------------------------
Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
ScatHUnion(2, 1, i15, 1) o 
BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
GathH(4, 2, i15, 2) o 
GathH(5, 4, 1, 1)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
ScatHUnion(2, 1, i15, 1) o 
BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
GathH(4, 2, i15, 2) o 
GathH(5, 4, 1, 1)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: OLCompose_Assoc
------------------------------------------------------------------
old expression
------------------------------------------------------------------
Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
ScatHUnion(2, 1, i15, 1) o 
BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
GathH(4, 2, i15, 2) o 
GathH(5, 4, 1, 1)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
ScatHUnion(2, 1, i15, 1) o 
BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
GathH(4, 2, i15, 2) o 
GathH(5, 4, 1, 1)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: PointWise_ScatHUnion
------------------------------------------------------------------
old expression
------------------------------------------------------------------
Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
ScatHUnion(2, 1, i15, 1) o 
BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
GathH(4, 2, i15, 2) o 
GathH(5, 4, 1, 1)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
ScatHUnion(2, 1, i15, 1) o 
PointWise(1, Lambda([ r11, i16 ], abs(r11))) o 
BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
GathH(4, 2, i15, 2) o 
GathH(5, 4, 1, 1)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: Reduction_ScatHUnion
------------------------------------------------------------------
old expression
------------------------------------------------------------------
Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
ScatHUnion(2, 1, i15, 1) o 
PointWise(1, Lambda([ r11, i16 ], abs(r11))) o 
BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
GathH(4, 2, i15, 2) o 
GathH(5, 4, 1, 1)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
PointWise(1, Lambda([ r11, i16 ], abs(r11))) o 
BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
GathH(4, 2, i15, 2) o 
GathH(5, 4, 1, 1)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: GathH_GathH
------------------------------------------------------------------
old expression
------------------------------------------------------------------
PointWise(1, Lambda([ r11, i16 ], abs(r11))) o 
BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
GathH(4, 2, i15, 2) o 
GathH(5, 4, 1, 1)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
PointWise(1, Lambda([ r11, i16 ], abs(r11))) o 
BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
GathH(5, 2, add(i15, V(1)), 2)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: PointWise_BinOp
------------------------------------------------------------------
old expression
------------------------------------------------------------------
PointWise(1, Lambda([ r11, i16 ], abs(r11))) o 
BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
GathH(5, 2, add(i15, V(1)), 2)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
BinOp(1, Lambda([ r12, r13 ], abs(sub(r12, r13)))) o 
GathH(5, 2, add(i15, V(1)), 2)
------------------------------------------------------------------

******************************************************************
END PROOF: SigmaSPL -> SigmaSPL
------------------------------------------------------------------
Final SigmaSPL
------------------------------------------------------------------
BinOp(1, Lambda([ r14, r15 ], geq(r15, r14))) o 
SUMUnion(
  ScatHUnion(2, 1, 0, 1) o 
  Reduction(3, (a, b) -> add(a, b), V(0.0), (arg) -> false) o 
  PointWise(3, Lambda([ r16, i14 ], mul(r16, nth(D, i14)))) o 
  Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
  GathH(5, 1, 0, 1), 
  ScatHUnion(2, 1, 1, 1) o 
  ISumReduction(i15, 2, (a, b) -> max(a, b), V(0.0), (arg) -> false,
    BinOp(1, Lambda([ r12, r13 ], abs(sub(r12, r13)))) o 
    GathH(5, 2, add(i15, V(1)), 2)
  )
)
******************************************************************


******************************************************************
BEGIN PROOF: SigmaSPL -> SigmaSPL
------------------------------------------------------------------
Ruleset:RulesTerminateReductionHACMS
------------------------------------------------------------------
Initial SigmaSPL
------------------------------------------------------------------
BinOp(1, Lambda([ r14, r15 ], geq(r15, r14))) o 
SUMUnion(
  ScatHUnion(2, 1, 0, 1) o 
  Reduction(3, (a, b) -> add(a, b), V(0.0), (arg) -> false) o 
  PointWise(3, Lambda([ r16, i14 ], mul(r16, nth(D, i14)))) o 
  Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
  GathH(5, 1, 0, 1), 
  ScatHUnion(2, 1, 1, 1) o 
  ISumReduction(i15, 2, (a, b) -> max(a, b), V(0.0), (arg) -> false,
    BinOp(1, Lambda([ r12, r13 ], abs(sub(r12, r13)))) o 
    GathH(5, 2, add(i15, V(1)), 2)
  )
)
******************************************************************

------------------------------------------------------------------
RULE: ScatHUnion1_terminate
------------------------------------------------------------------
old expression
------------------------------------------------------------------
ScatHUnion(2, 1, 0, 1)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
eUnion(2, 0)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: Reduction_terminate
------------------------------------------------------------------
old expression
------------------------------------------------------------------
Reduction(3, (a, b) -> add(a, b), V(0.0), (arg) -> false)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
ISumReduction(i17, 3, (a, b) -> add(a, b), V(0.0), (arg) -> false,
  eT(3, i17)
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: GathH1_terminate
------------------------------------------------------------------
old expression
------------------------------------------------------------------
GathH(5, 1, 0, 1)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
eT(5, 0)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: ScatHUnion1_terminate
------------------------------------------------------------------
old expression
------------------------------------------------------------------
ScatHUnion(2, 1, 1, 1)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
eUnion(2, 1)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: GathHN_terminate
------------------------------------------------------------------
old expression
------------------------------------------------------------------
GathH(5, 2, add(i15, V(1)), 2)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
ISumUnion(i18, 2,
  eUnion(2, i18) o 
  eT(5, add(add(i15, V(1)), mul(V(2), i18)))
)
------------------------------------------------------------------

******************************************************************
END PROOF: SigmaSPL -> SigmaSPL
------------------------------------------------------------------
Final SigmaSPL
------------------------------------------------------------------
BinOp(1, Lambda([ r14, r15 ], geq(r15, r14))) o 
SUMUnion(
  eUnion(2, 0) o 
  ISumReduction(i17, 3, (a, b) -> add(a, b), V(0.0), (arg) -> false,
    eT(3, i17)
  ) o 
  PointWise(3, Lambda([ r16, i14 ], mul(r16, nth(D, i14)))) o 
  Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
  eT(5, 0), 
  eUnion(2, 1) o 
  ISumReduction(i15, 2, (a, b) -> max(a, b), V(0.0), (arg) -> false,
    BinOp(1, Lambda([ r12, r13 ], abs(sub(r12, r13)))) o 
    ISumUnion(i18, 2,
      eUnion(2, i18) o 
      eT(5, add(add(i15, V(1)), mul(V(2), i18)))
    )
  )
)
******************************************************************


******************************************************************
BEGIN PROOF: SigmaSPL -> SigmaSPL
------------------------------------------------------------------
Ruleset:RulesSumsHACMS
------------------------------------------------------------------
Initial SigmaSPL
------------------------------------------------------------------
BinOp(1, Lambda([ r14, r15 ], geq(r15, r14))) o 
SUMUnion(
  eUnion(2, 0) o 
  ISumReduction(i17, 3, (a, b) -> add(a, b), V(0.0), (arg) -> false,
    eT(3, i17)
  ) o 
  PointWise(3, Lambda([ r16, i14 ], mul(r16, nth(D, i14)))) o 
  Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
  eT(5, 0), 
  eUnion(2, 1) o 
  ISumReduction(i15, 2, (a, b) -> max(a, b), V(0.0), (arg) -> false,
    BinOp(1, Lambda([ r12, r13 ], abs(sub(r12, r13)))) o 
    ISumUnion(i18, 2,
      eUnion(2, i18) o 
      eT(5, add(add(i15, V(1)), mul(V(2), i18)))
    )
  )
)
******************************************************************

------------------------------------------------------------------
RULE: ISumReduction_PointWise
------------------------------------------------------------------
old expression
------------------------------------------------------------------
eUnion(2, 0) o 
ISumReduction(i17, 3, (a, b) -> add(a, b), V(0.0), (arg) -> false,
  eT(3, i17)
) o 
PointWise(3, Lambda([ r16, i14 ], mul(r16, nth(D, i14)))) o 
Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
eT(5, 0)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
eUnion(2, 0) o 
ISumReduction(i17, 3, (a, b) -> add(a, b), V(0.0), (arg) -> false,
  eT(3, i17) o 
  PointWise(3, Lambda([ r16, i14 ], mul(r16, nth(D, i14))))
) o 
Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
eT(5, 0)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: ISumXXX_YYY
------------------------------------------------------------------
old expression
------------------------------------------------------------------
eUnion(2, 0) o 
ISumReduction(i17, 3, (a, b) -> add(a, b), V(0.0), (arg) -> false,
  eT(3, i17) o 
  PointWise(3, Lambda([ r16, i14 ], mul(r16, nth(D, i14))))
) o 
Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
eT(5, 0)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
eUnion(2, 0) o 
ISumReduction(i17, 3, (a, b) -> add(a, b), V(0.0), (arg) -> false,
  eT(3, i17) o 
  PointWise(3, Lambda([ r16, i14 ], mul(r16, nth(D, i14)))) o 
  Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0))
) o 
eT(5, 0)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: ISumXXX_YYY
------------------------------------------------------------------
old expression
------------------------------------------------------------------
eUnion(2, 0) o 
ISumReduction(i17, 3, (a, b) -> add(a, b), V(0.0), (arg) -> false,
  eT(3, i17) o 
  PointWise(3, Lambda([ r16, i14 ], mul(r16, nth(D, i14)))) o 
  Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0))
) o 
eT(5, 0)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
eUnion(2, 0) o 
ISumReduction(i17, 3, (a, b) -> add(a, b), V(0.0), (arg) -> false,
  eT(3, i17) o 
  PointWise(3, Lambda([ r16, i14 ], mul(r16, nth(D, i14)))) o 
  Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
  eT(5, 0)
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: OLCompose_Assoc
------------------------------------------------------------------
old expression
------------------------------------------------------------------
eT(3, i17) o 
PointWise(3, Lambda([ r16, i14 ], mul(r16, nth(D, i14)))) o 
Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
eT(5, 0)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
eT(3, i17) o 
PointWise(3, Lambda([ r16, i14 ], mul(r16, nth(D, i14)))) o 
Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
eT(5, 0)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: OLCompose_Assoc
------------------------------------------------------------------
old expression
------------------------------------------------------------------
eT(3, i17) o 
PointWise(3, Lambda([ r16, i14 ], mul(r16, nth(D, i14)))) o 
Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
eT(5, 0)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
eT(3, i17) o 
PointWise(3, Lambda([ r16, i14 ], mul(r16, nth(D, i14)))) o 
Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
eT(5, 0)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: eT_Pointwise
------------------------------------------------------------------
old expression
------------------------------------------------------------------
eT(3, i17) o 
PointWise(3, Lambda([ r16, i14 ], mul(r16, nth(D, i14)))) o 
Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
eT(5, 0)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
PointWise(1, Lambda([ r16, i19 ], mul(r16, nth(D, i17)))) o 
eT(3, i17) o 
Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
eT(5, 0)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: eT_Induction
------------------------------------------------------------------
old expression
------------------------------------------------------------------
PointWise(1, Lambda([ r16, i19 ], mul(r16, nth(D, i17)))) o 
eT(3, i17) o 
Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
eT(5, 0)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
PointWise(1, Lambda([ r16, i19 ], mul(r16, nth(D, i17)))) o 
Inductor(3, i17, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
eT(5, 0)
------------------------------------------------------------------

******************************************************************
END PROOF: SigmaSPL -> SigmaSPL
------------------------------------------------------------------
Final SigmaSPL
------------------------------------------------------------------
BinOp(1, Lambda([ r14, r15 ], geq(r15, r14))) o 
SUMUnion(
  eUnion(2, 0) o 
  ISumReduction(i17, 3, (a, b) -> add(a, b), V(0.0), (arg) -> false,
    PointWise(1, Lambda([ r16, i19 ], mul(r16, nth(D, i17)))) o 
    Inductor(3, i17, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
    eT(5, 0)
  ), 
  eUnion(2, 1) o 
  ISumReduction(i15, 2, (a, b) -> max(a, b), V(0.0), (arg) -> false,
    BinOp(1, Lambda([ r12, r13 ], abs(sub(r12, r13)))) o 
    ISumUnion(i18, 2,
      eUnion(2, i18) o 
      eT(5, add(add(i15, V(1)), mul(V(2), i18)))
    )
  )
)
******************************************************************

******************************************************************
BEGIN PROOF: Sigma-SPL -> icode
------------------------------------------------------------------
Sigma-SPL expression:
------------------------------------------------------------------
BinOp(1, Lambda([ r14, r15 ], geq(r15, r14))) o 
SUMUnion(
  eUnion(2, 0) o 
  ISumReduction(i17, 3, (a, b) -> add(a, b), V(0.0), (arg) -> false,
    PointWise(1, Lambda([ r16, i19 ], mul(r16, nth(D, i17)))) o 
    Inductor(3, i17, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
    eT(5, 0)
  ), 
  eUnion(2, 1) o 
  ISumReduction(i15, 2, (a, b) -> max(a, b), V(0.0), (arg) -> false,
    BinOp(1, Lambda([ r12, r13 ], abs(sub(r12, r13)))) o 
    ISumUnion(i18, 2,
      eUnion(2, i18) o 
      eT(5, add(add(i15, V(1)), mul(V(2), i18)))
    )
  )
)
******************************************************************

==================================================================
EXPANSION RULE: eT
------------------------------------------------------------------
Signma-SPL expression:
------------------------------------------------------------------
eT(5, 0)
------------------------------------------------------------------
icode:
------------------------------------------------------------------
assign(nth(T14, V(0)), nth(X, V(0)))


==================================================================
EXPANSION RULE: Inductor
------------------------------------------------------------------
Signma-SPL expression:
------------------------------------------------------------------
Inductor(3, i17, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0))
------------------------------------------------------------------
icode:
------------------------------------------------------------------
assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0)))))


==================================================================
EXPANSION RULE: PointWise
------------------------------------------------------------------
Signma-SPL expression:
------------------------------------------------------------------
PointWise(1, Lambda([ r16, i19 ], mul(r16, nth(D, i17))))
------------------------------------------------------------------
icode:
------------------------------------------------------------------
assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))


==================================================================
EXPANSION RULE: OLCompose
------------------------------------------------------------------
Signma-SPL expression:
------------------------------------------------------------------
PointWise(1, Lambda([ r16, i19 ], mul(r16, nth(D, i17)))) o 
Inductor(3, i17, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
eT(5, 0)
------------------------------------------------------------------
icode:
------------------------------------------------------------------
decl([ T13, T14 ],
   chain(
      assign(nth(T14, V(0)), nth(X, V(0))),
      assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
      assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
   )
)


==================================================================
EXPANSION RULE: ISumReduction
------------------------------------------------------------------
Signma-SPL expression:
------------------------------------------------------------------
ISumReduction(i17, 3, (a, b) -> add(a, b), V(0.0), (arg) -> false,
  PointWise(1, Lambda([ r16, i19 ], mul(r16, nth(D, i17)))) o 
  Inductor(3, i17, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
  eT(5, 0)
)
------------------------------------------------------------------
icode:
------------------------------------------------------------------
chain(
   assign(nth(T11, V(0)), V(0.0)),
   loop(i17, [ 0 .. 2 ],
      decl([ T12 ],
         chain(
            decl([ T13, T14 ],
               chain(
                  assign(nth(T14, V(0)), nth(X, V(0))),
                  assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                  assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
               )
            ),
            assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
         )
      )
   )
)


==================================================================
EXPANSION RULE: eUnion
------------------------------------------------------------------
Signma-SPL expression:
------------------------------------------------------------------
eUnion(2, 0)
------------------------------------------------------------------
icode:
------------------------------------------------------------------
assign(nth(T10, V(0)), nth(T11, V(0)))


==================================================================
EXPANSION RULE: OLCompose
------------------------------------------------------------------
Signma-SPL expression:
------------------------------------------------------------------
eUnion(2, 0) o 
ISumReduction(i17, 3, (a, b) -> add(a, b), V(0.0), (arg) -> false,
  PointWise(1, Lambda([ r16, i19 ], mul(r16, nth(D, i17)))) o 
  Inductor(3, i17, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
  eT(5, 0)
)
------------------------------------------------------------------
icode:
------------------------------------------------------------------
decl([ T11 ],
   chain(
      chain(
         assign(nth(T11, V(0)), V(0.0)),
         loop(i17, [ 0 .. 2 ],
            decl([ T12 ],
               chain(
                  decl([ T13, T14 ],
                     chain(
                        assign(nth(T14, V(0)), nth(X, V(0))),
                        assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                        assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
                     )
                  ),
                  assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
               )
            )
         )
      ),
      assign(nth(T10, V(0)), nth(T11, V(0)))
   )
)


==================================================================
EXPANSION RULE: eT
------------------------------------------------------------------
Signma-SPL expression:
------------------------------------------------------------------
eT(5, add(add(i15, V(1)), mul(V(2), i18)))
------------------------------------------------------------------
icode:
------------------------------------------------------------------
assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18))))


==================================================================
EXPANSION RULE: eUnion
------------------------------------------------------------------
Signma-SPL expression:
------------------------------------------------------------------
eUnion(2, i18)
------------------------------------------------------------------
icode:
------------------------------------------------------------------
assign(nth(T17, i18), nth(T18, V(0)))


==================================================================
EXPANSION RULE: OLCompose
------------------------------------------------------------------
Signma-SPL expression:
------------------------------------------------------------------
eUnion(2, i18) o 
eT(5, add(add(i15, V(1)), mul(V(2), i18)))
------------------------------------------------------------------
icode:
------------------------------------------------------------------
decl([ T18 ],
   chain(
      assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
      assign(nth(T17, i18), nth(T18, V(0)))
   )
)


==================================================================
EXPANSION RULE: ISumUnion
------------------------------------------------------------------
Signma-SPL expression:
------------------------------------------------------------------
ISumUnion(i18, 2,
  eUnion(2, i18) o 
  eT(5, add(add(i15, V(1)), mul(V(2), i18)))
)
------------------------------------------------------------------
icode:
------------------------------------------------------------------
loop(i18, [ 0 .. 1 ],
   decl([ T18 ],
      chain(
         assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
         assign(nth(T17, i18), nth(T18, V(0)))
      )
   )
)


==================================================================
EXPANSION RULE: BinOp
------------------------------------------------------------------
Signma-SPL expression:
------------------------------------------------------------------
BinOp(1, Lambda([ r12, r13 ], abs(sub(r12, r13))))
------------------------------------------------------------------
icode:
------------------------------------------------------------------
assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))


==================================================================
EXPANSION RULE: OLCompose
------------------------------------------------------------------
Signma-SPL expression:
------------------------------------------------------------------
BinOp(1, Lambda([ r12, r13 ], abs(sub(r12, r13)))) o 
ISumUnion(i18, 2,
  eUnion(2, i18) o 
  eT(5, add(add(i15, V(1)), mul(V(2), i18)))
)
------------------------------------------------------------------
icode:
------------------------------------------------------------------
decl([ T17 ],
   chain(
      loop(i18, [ 0 .. 1 ],
         decl([ T18 ],
            chain(
               assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
               assign(nth(T17, i18), nth(T18, V(0)))
            )
         )
      ),
      assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
   )
)


==================================================================
EXPANSION RULE: ISumReduction
------------------------------------------------------------------
Signma-SPL expression:
------------------------------------------------------------------
ISumReduction(i15, 2, (a, b) -> max(a, b), V(0.0), (arg) -> false,
  BinOp(1, Lambda([ r12, r13 ], abs(sub(r12, r13)))) o 
  ISumUnion(i18, 2,
    eUnion(2, i18) o 
    eT(5, add(add(i15, V(1)), mul(V(2), i18)))
  )
)
------------------------------------------------------------------
icode:
------------------------------------------------------------------
chain(
   assign(nth(T15, V(0)), V(0.0)),
   loop(i15, [ 0 .. 1 ],
      decl([ T16 ],
         chain(
            decl([ T17 ],
               chain(
                  loop(i18, [ 0 .. 1 ],
                     decl([ T18 ],
                        chain(
                           assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                           assign(nth(T17, i18), nth(T18, V(0)))
                        )
                     )
                  ),
                  assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
               )
            ),
            assign(nth(T15, V(0)), max(nth(T16, V(0)), nth(T15, V(0))))
         )
      )
   )
)


==================================================================
EXPANSION RULE: eUnion
------------------------------------------------------------------
Signma-SPL expression:
------------------------------------------------------------------
eUnion(2, 1)
------------------------------------------------------------------
icode:
------------------------------------------------------------------
assign(nth(T10, V(1)), nth(T15, V(0)))


==================================================================
EXPANSION RULE: OLCompose
------------------------------------------------------------------
Signma-SPL expression:
------------------------------------------------------------------
eUnion(2, 1) o 
ISumReduction(i15, 2, (a, b) -> max(a, b), V(0.0), (arg) -> false,
  BinOp(1, Lambda([ r12, r13 ], abs(sub(r12, r13)))) o 
  ISumUnion(i18, 2,
    eUnion(2, i18) o 
    eT(5, add(add(i15, V(1)), mul(V(2), i18)))
  )
)
------------------------------------------------------------------
icode:
------------------------------------------------------------------
decl([ T15 ],
   chain(
      chain(
         assign(nth(T15, V(0)), V(0.0)),
         loop(i15, [ 0 .. 1 ],
            decl([ T16 ],
               chain(
                  decl([ T17 ],
                     chain(
                        loop(i18, [ 0 .. 1 ],
                           decl([ T18 ],
                              chain(
                                 assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                                 assign(nth(T17, i18), nth(T18, V(0)))
                              )
                           )
                        ),
                        assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                     )
                  ),
                  assign(nth(T15, V(0)), max(nth(T16, V(0)), nth(T15, V(0))))
               )
            )
         )
      ),
      assign(nth(T10, V(1)), nth(T15, V(0)))
   )
)


==================================================================
EXPANSION RULE: SUMUnion
------------------------------------------------------------------
Signma-SPL expression:
------------------------------------------------------------------
SUMUnion(
  eUnion(2, 0) o 
  ISumReduction(i17, 3, (a, b) -> add(a, b), V(0.0), (arg) -> false,
    PointWise(1, Lambda([ r16, i19 ], mul(r16, nth(D, i17)))) o 
    Inductor(3, i17, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
    eT(5, 0)
  ), 
  eUnion(2, 1) o 
  ISumReduction(i15, 2, (a, b) -> max(a, b), V(0.0), (arg) -> false,
    BinOp(1, Lambda([ r12, r13 ], abs(sub(r12, r13)))) o 
    ISumUnion(i18, 2,
      eUnion(2, i18) o 
      eT(5, add(add(i15, V(1)), mul(V(2), i18)))
    )
  )
)
------------------------------------------------------------------
icode:
------------------------------------------------------------------
chain(
   decl([ T11 ],
      chain(
         chain(
            assign(nth(T11, V(0)), V(0.0)),
            loop(i17, [ 0 .. 2 ],
               decl([ T12 ],
                  chain(
                     decl([ T13, T14 ],
                        chain(
                           assign(nth(T14, V(0)), nth(X, V(0))),
                           assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                           assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
                        )
                     ),
                     assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                  )
               )
            )
         ),
         assign(nth(T10, V(0)), nth(T11, V(0)))
      )
   ),
   decl([ T15 ],
      chain(
         chain(
            assign(nth(T15, V(0)), V(0.0)),
            loop(i15, [ 0 .. 1 ],
               decl([ T16 ],
                  chain(
                     decl([ T17 ],
                        chain(
                           loop(i18, [ 0 .. 1 ],
                              decl([ T18 ],
                                 chain(
                                    assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                                    assign(nth(T17, i18), nth(T18, V(0)))
                                 )
                              )
                           ),
                           assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                        )
                     ),
                     assign(nth(T15, V(0)), max(nth(T16, V(0)), nth(T15, V(0))))
                  )
               )
            )
         ),
         assign(nth(T10, V(1)), nth(T15, V(0)))
      )
   )
)


==================================================================
EXPANSION RULE: BinOp
------------------------------------------------------------------
Signma-SPL expression:
------------------------------------------------------------------
BinOp(1, Lambda([ r14, r15 ], geq(r15, r14)))
------------------------------------------------------------------
icode:
------------------------------------------------------------------
assign(nth(Y, V(0)), geq(nth(T10, V(1)), nth(T10, V(0))))


******************************************************************
END PROOF: Sigma-SPL -> icode
------------------------------------------------------------------
icode:
------------------------------------------------------------------
func(TInt, "transform", [ X, D ], 
   decl([ T10 ],
      chain(
         chain(
            decl([ T11 ],
               chain(
                  chain(
                     assign(nth(T11, V(0)), V(0.0)),
                     loop(i17, [ 0 .. 2 ],
                        decl([ T12 ],
                           chain(
                              decl([ T13, T14 ],
                                 chain(
                                    assign(nth(T14, V(0)), nth(X, V(0))),
                                    assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                                    assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
                                 )
                              ),
                              assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                           )
                        )
                     )
                  ),
                  assign(nth(T10, V(0)), nth(T11, V(0)))
               )
            ),
            decl([ T15 ],
               chain(
                  chain(
                     assign(nth(T15, V(0)), V(0.0)),
                     loop(i15, [ 0 .. 1 ],
                        decl([ T16 ],
                           chain(
                              decl([ T17 ],
                                 chain(
                                    loop(i18, [ 0 .. 1 ],
                                       decl([ T18 ],
                                          chain(
                                             assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                                             assign(nth(T17, i18), nth(T18, V(0)))
                                          )
                                       )
                                    ),
                                    assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                                 )
                              ),
                              assign(nth(T15, V(0)), max(nth(T16, V(0)), nth(T15, V(0))))
                           )
                        )
                     )
                  ),
                  assign(nth(T10, V(1)), nth(T15, V(0)))
               )
            )
         ),
         assign(nth(Y, V(0)), geq(nth(T10, V(1)), nth(T10, V(0))))
      )
   )
)
******************************************************************


******************************************************************
BEGIN PROOF: iCode -> iCode
------------------------------------------------------------------
Ruleset:MergedRuleSet(RulesUnrollHACMS, RulesStrengthReduce, RulesCodeHACMS)
------------------------------------------------------------------
Initial iCode
------------------------------------------------------------------
func(TInt, "transform", [ X, D ], 
   decl([ T10 ],
      chain(
         chain(
            decl([ T11 ],
               chain(
                  chain(
                     assign(nth(T11, V(0)), V(0.0)),
                     loop(i17, [ 0 .. 2 ],
                        decl([ T12 ],
                           chain(
                              decl([ T13, T14 ],
                                 chain(
                                    assign(nth(T14, V(0)), nth(X, V(0))),
                                    assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                                    assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
                                 )
                              ),
                              assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                           )
                        )
                     )
                  ),
                  assign(nth(T10, V(0)), nth(T11, V(0)))
               )
            ),
            decl([ T15 ],
               chain(
                  chain(
                     assign(nth(T15, V(0)), V(0.0)),
                     loop(i15, [ 0 .. 1 ],
                        decl([ T16 ],
                           chain(
                              decl([ T17 ],
                                 chain(
                                    loop(i18, [ 0 .. 1 ],
                                       decl([ T18 ],
                                          chain(
                                             assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                                             assign(nth(T17, i18), nth(T18, V(0)))
                                          )
                                       )
                                    ),
                                    assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                                 )
                              ),
                              assign(nth(T15, V(0)), max(nth(T16, V(0)), nth(T15, V(0))))
                           )
                        )
                     )
                  ),
                  assign(nth(T10, V(1)), nth(T15, V(0)))
               )
            )
         ),
         assign(nth(Y, V(0)), geq(nth(T10, V(1)), nth(T10, V(0))))
      )
   )
)
******************************************************************

------------------------------------------------------------------
RULE: scalarize_const
------------------------------------------------------------------
old expression
------------------------------------------------------------------
decl([ T10 ],
   chain(
      chain(
         decl([ T11 ],
            chain(
               chain(
                  assign(nth(T11, V(0)), V(0.0)),
                  loop(i17, [ 0 .. 2 ],
                     decl([ T12 ],
                        chain(
                           decl([ T13, T14 ],
                              chain(
                                 assign(nth(T14, V(0)), nth(X, V(0))),
                                 assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                                 assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
                              )
                           ),
                           assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                        )
                     )
                  )
               ),
               assign(nth(T10, V(0)), nth(T11, V(0)))
            )
         ),
         decl([ T15 ],
            chain(
               chain(
                  assign(nth(T15, V(0)), V(0.0)),
                  loop(i15, [ 0 .. 1 ],
                     decl([ T16 ],
                        chain(
                           decl([ T17 ],
                              chain(
                                 loop(i18, [ 0 .. 1 ],
                                    decl([ T18 ],
                                       chain(
                                          assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                                          assign(nth(T17, i18), nth(T18, V(0)))
                                       )
                                    )
                                 ),
                                 assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                              )
                           ),
                           assign(nth(T15, V(0)), max(nth(T16, V(0)), nth(T15, V(0))))
                        )
                     )
                  )
               ),
               assign(nth(T10, V(1)), nth(T15, V(0)))
            )
         )
      ),
      assign(nth(Y, V(0)), geq(nth(T10, V(1)), nth(T10, V(0))))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T10, V(0))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
q5
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T10, V(0))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
q5
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T10, V(1))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
q6
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T10, V(1))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
q6
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ q5, q6 ],
   chain(
      chain(
         decl([ T11 ],
            chain(
               chain(
                  assign(nth(T11, V(0)), V(0.0)),
                  loop(i17, [ 0 .. 2 ],
                     decl([ T12 ],
                        chain(
                           decl([ T13, T14 ],
                              chain(
                                 assign(nth(T14, V(0)), nth(X, V(0))),
                                 assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                                 assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
                              )
                           ),
                           assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                        )
                     )
                  )
               ),
               assign(q5, nth(T11, V(0)))
            )
         ),
         decl([ T15 ],
            chain(
               chain(
                  assign(nth(T15, V(0)), V(0.0)),
                  loop(i15, [ 0 .. 1 ],
                     decl([ T16 ],
                        chain(
                           decl([ T17 ],
                              chain(
                                 loop(i18, [ 0 .. 1 ],
                                    decl([ T18 ],
                                       chain(
                                          assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                                          assign(nth(T17, i18), nth(T18, V(0)))
                                       )
                                    )
                                 ),
                                 assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                              )
                           ),
                           assign(nth(T15, V(0)), max(nth(T16, V(0)), nth(T15, V(0))))
                        )
                     )
                  )
               ),
               assign(q6, nth(T15, V(0)))
            )
         )
      ),
      assign(nth(Y, V(0)), geq(q6, q5))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      decl([ T11 ],
         chain(
            chain(
               assign(nth(T11, V(0)), V(0.0)),
               loop(i17, [ 0 .. 2 ],
                  decl([ T12 ],
                     chain(
                        decl([ T13, T14 ],
                           chain(
                              assign(nth(T14, V(0)), nth(X, V(0))),
                              assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                              assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
                           )
                        ),
                        assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                     )
                  )
               )
            ),
            assign(q5, nth(T11, V(0)))
         )
      ),
      decl([ T15 ],
         chain(
            chain(
               assign(nth(T15, V(0)), V(0.0)),
               loop(i15, [ 0 .. 1 ],
                  decl([ T16 ],
                     chain(
                        decl([ T17 ],
                           chain(
                              loop(i18, [ 0 .. 1 ],
                                 decl([ T18 ],
                                    chain(
                                       assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                                       assign(nth(T17, i18), nth(T18, V(0)))
                                    )
                                 )
                              ),
                              assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                           )
                        ),
                        assign(nth(T15, V(0)), max(nth(T16, V(0)), nth(T15, V(0))))
                     )
                  )
               )
            ),
            assign(q6, nth(T15, V(0)))
         )
      )
   ),
   assign(nth(Y, V(0)), geq(q6, q5))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   decl([ T11 ],
      chain(
         chain(
            assign(nth(T11, V(0)), V(0.0)),
            loop(i17, [ 0 .. 2 ],
               decl([ T12 ],
                  chain(
                     decl([ T13, T14 ],
                        chain(
                           assign(nth(T14, V(0)), nth(X, V(0))),
                           assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                           assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
                        )
                     ),
                     assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                  )
               )
            )
         ),
         assign(q5, nth(T11, V(0)))
      )
   ),
   decl([ T15 ],
      chain(
         chain(
            assign(nth(T15, V(0)), V(0.0)),
            loop(i15, [ 0 .. 1 ],
               decl([ T16 ],
                  chain(
                     decl([ T17 ],
                        chain(
                           loop(i18, [ 0 .. 1 ],
                              decl([ T18 ],
                                 chain(
                                    assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                                    assign(nth(T17, i18), nth(T18, V(0)))
                                 )
                              )
                           ),
                           assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                        )
                     ),
                     assign(nth(T15, V(0)), max(nth(T16, V(0)), nth(T15, V(0))))
                  )
               )
            )
         ),
         assign(q6, nth(T15, V(0)))
      )
   ),
   assign(nth(Y, V(0)), geq(q6, q5))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   decl([ T11 ],
      chain(
         chain(
            assign(nth(T11, V(0)), V(0.0)),
            loop(i17, [ 0 .. 2 ],
               decl([ T12 ],
                  chain(
                     decl([ T13, T14 ],
                        chain(
                           assign(nth(T14, V(0)), nth(X, V(0))),
                           assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                           assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
                        )
                     ),
                     assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                  )
               )
            )
         ),
         assign(q5, nth(T11, V(0)))
      )
   ),
   decl([ T15 ],
      chain(
         chain(
            assign(nth(T15, V(0)), V(0.0)),
            loop(i15, [ 0 .. 1 ],
               decl([ T16 ],
                  chain(
                     decl([ T17 ],
                        chain(
                           loop(i18, [ 0 .. 1 ],
                              decl([ T18 ],
                                 chain(
                                    assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                                    assign(nth(T17, i18), nth(T18, V(0)))
                                 )
                              )
                           ),
                           assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                        )
                     ),
                     assign(nth(T15, V(0)), max(nth(T16, V(0)), nth(T15, V(0))))
                  )
               )
            )
         ),
         assign(q6, nth(T15, V(0)))
      )
   ),
   assign(nth(Y, V(0)), geq(q6, q5))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   decl([ T15 ],
      chain(
         decl([ T11 ],
            chain(
               chain(
                  assign(nth(T11, V(0)), V(0.0)),
                  loop(i17, [ 0 .. 2 ],
                     decl([ T12 ],
                        chain(
                           decl([ T13, T14 ],
                              chain(
                                 assign(nth(T14, V(0)), nth(X, V(0))),
                                 assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                                 assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
                              )
                           ),
                           assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                        )
                     )
                  )
               ),
               assign(q5, nth(T11, V(0)))
            )
         ),
         chain(
            chain(
               assign(nth(T15, V(0)), V(0.0)),
               loop(i15, [ 0 .. 1 ],
                  decl([ T16 ],
                     chain(
                        decl([ T17 ],
                           chain(
                              loop(i18, [ 0 .. 1 ],
                                 decl([ T18 ],
                                    chain(
                                       assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                                       assign(nth(T17, i18), nth(T18, V(0)))
                                    )
                                 )
                              ),
                              assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                           )
                        ),
                        assign(nth(T15, V(0)), max(nth(T16, V(0)), nth(T15, V(0))))
                     )
                  )
               )
            ),
            assign(q6, nth(T15, V(0)))
         )
      )
   ),
   assign(nth(Y, V(0)), geq(q6, q5))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: scalarize1
------------------------------------------------------------------
old expression
------------------------------------------------------------------
decl([ T15 ],
   chain(
      decl([ T11 ],
         chain(
            chain(
               assign(nth(T11, V(0)), V(0.0)),
               loop(i17, [ 0 .. 2 ],
                  decl([ T12 ],
                     chain(
                        decl([ T13, T14 ],
                           chain(
                              assign(nth(T14, V(0)), nth(X, V(0))),
                              assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                              assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
                           )
                        ),
                        assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                     )
                  )
               )
            ),
            assign(q5, nth(T11, V(0)))
         )
      ),
      chain(
         chain(
            assign(nth(T15, V(0)), V(0.0)),
            loop(i15, [ 0 .. 1 ],
               decl([ T16 ],
                  chain(
                     decl([ T17 ],
                        chain(
                           loop(i18, [ 0 .. 1 ],
                              decl([ T18 ],
                                 chain(
                                    assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                                    assign(nth(T17, i18), nth(T18, V(0)))
                                 )
                              )
                           ),
                           assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                        )
                     ),
                     assign(nth(T15, V(0)), max(nth(T16, V(0)), nth(T15, V(0))))
                  )
               )
            )
         ),
         assign(q6, nth(T15, V(0)))
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T15, V(0))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
s9
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T15, V(0))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
s9
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T15, V(0))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
s9
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T15, V(0))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
s9
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ s9 ],
   chain(
      decl([ T11 ],
         chain(
            chain(
               assign(nth(T11, V(0)), V(0.0)),
               loop(i17, [ 0 .. 2 ],
                  decl([ T12 ],
                     chain(
                        decl([ T13, T14 ],
                           chain(
                              assign(nth(T14, V(0)), nth(X, V(0))),
                              assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                              assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
                           )
                        ),
                        assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                     )
                  )
               )
            ),
            assign(q5, nth(T11, V(0)))
         )
      ),
      chain(
         chain(
            assign(s9, V(0.0)),
            loop(i15, [ 0 .. 1 ],
               decl([ T16 ],
                  chain(
                     decl([ T17 ],
                        chain(
                           loop(i18, [ 0 .. 1 ],
                              decl([ T18 ],
                                 chain(
                                    assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                                    assign(nth(T17, i18), nth(T18, V(0)))
                                 )
                              )
                           ),
                           assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                        )
                     ),
                     assign(s9, max(s9, nth(T16, V(0))))
                  )
               )
            )
         ),
         assign(q6, s9)
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   decl([ T11 ],
      chain(
         chain(
            assign(nth(T11, V(0)), V(0.0)),
            loop(i17, [ 0 .. 2 ],
               decl([ T12 ],
                  chain(
                     decl([ T13, T14 ],
                        chain(
                           assign(nth(T14, V(0)), nth(X, V(0))),
                           assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                           assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
                        )
                     ),
                     assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                  )
               )
            )
         ),
         assign(q5, nth(T11, V(0)))
      )
   ),
   chain(
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            decl([ T16 ],
               chain(
                  decl([ T17 ],
                     chain(
                        loop(i18, [ 0 .. 1 ],
                           decl([ T18 ],
                              chain(
                                 assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                                 assign(nth(T17, i18), nth(T18, V(0)))
                              )
                           )
                        ),
                        assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                     )
                  ),
                  assign(s9, max(s9, nth(T16, V(0))))
               )
            )
         )
      ),
      assign(q6, s9)
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ T11 ],
   chain(
      chain(
         chain(
            assign(nth(T11, V(0)), V(0.0)),
            loop(i17, [ 0 .. 2 ],
               decl([ T12 ],
                  chain(
                     decl([ T13, T14 ],
                        chain(
                           assign(nth(T14, V(0)), nth(X, V(0))),
                           assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                           assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
                        )
                     ),
                     assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                  )
               )
            )
         ),
         assign(q5, nth(T11, V(0)))
      ),
      chain(
         chain(
            assign(s9, V(0.0)),
            loop(i15, [ 0 .. 1 ],
               decl([ T16 ],
                  chain(
                     decl([ T17 ],
                        chain(
                           loop(i18, [ 0 .. 1 ],
                              decl([ T18 ],
                                 chain(
                                    assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                                    assign(nth(T17, i18), nth(T18, V(0)))
                                 )
                              )
                           ),
                           assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                        )
                     ),
                     assign(s9, max(s9, nth(T16, V(0))))
                  )
               )
            )
         ),
         assign(q6, s9)
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      chain(
         assign(nth(T11, V(0)), V(0.0)),
         loop(i17, [ 0 .. 2 ],
            decl([ T12 ],
               chain(
                  decl([ T13, T14 ],
                     chain(
                        assign(nth(T14, V(0)), nth(X, V(0))),
                        assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                        assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
                     )
                  ),
                  assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
               )
            )
         )
      ),
      assign(q5, nth(T11, V(0)))
   ),
   chain(
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            decl([ T16 ],
               chain(
                  decl([ T17 ],
                     chain(
                        loop(i18, [ 0 .. 1 ],
                           decl([ T18 ],
                              chain(
                                 assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                                 assign(nth(T17, i18), nth(T18, V(0)))
                              )
                           )
                        ),
                        assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                     )
                  ),
                  assign(s9, max(s9, nth(T16, V(0))))
               )
            )
         )
      ),
      assign(q6, s9)
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(nth(T11, V(0)), V(0.0)),
      loop(i17, [ 0 .. 2 ],
         decl([ T12 ],
            chain(
               decl([ T13, T14 ],
                  chain(
                     assign(nth(T14, V(0)), nth(X, V(0))),
                     assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                     assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
                  )
               ),
               assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
            )
         )
      )
   ),
   assign(q5, nth(T11, V(0))),
   chain(
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            decl([ T16 ],
               chain(
                  decl([ T17 ],
                     chain(
                        loop(i18, [ 0 .. 1 ],
                           decl([ T18 ],
                              chain(
                                 assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                                 assign(nth(T17, i18), nth(T18, V(0)))
                              )
                           )
                        ),
                        assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                     )
                  ),
                  assign(s9, max(s9, nth(T16, V(0))))
               )
            )
         )
      ),
      assign(q6, s9)
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      assign(nth(T11, V(0)), V(0.0)),
      loop(i17, [ 0 .. 2 ],
         decl([ T12 ],
            chain(
               decl([ T13, T14 ],
                  chain(
                     assign(nth(T14, V(0)), nth(X, V(0))),
                     assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                     assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
                  )
               ),
               assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
            )
         )
      )
   ),
   assign(q5, nth(T11, V(0))),
   chain(
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            decl([ T16 ],
               chain(
                  decl([ T17 ],
                     chain(
                        loop(i18, [ 0 .. 1 ],
                           decl([ T18 ],
                              chain(
                                 assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                                 assign(nth(T17, i18), nth(T18, V(0)))
                              )
                           )
                        ),
                        assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                     )
                  ),
                  assign(s9, max(s9, nth(T16, V(0))))
               )
            )
         )
      ),
      assign(q6, s9)
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(nth(T11, V(0)), V(0.0)),
   loop(i17, [ 0 .. 2 ],
      decl([ T12 ],
         chain(
            decl([ T13, T14 ],
               chain(
                  assign(nth(T14, V(0)), nth(X, V(0))),
                  assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                  assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
               )
            ),
            assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
         )
      )
   ),
   assign(q5, nth(T11, V(0))),
   chain(
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            decl([ T16 ],
               chain(
                  decl([ T17 ],
                     chain(
                        loop(i18, [ 0 .. 1 ],
                           decl([ T18 ],
                              chain(
                                 assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                                 assign(nth(T17, i18), nth(T18, V(0)))
                              )
                           )
                        ),
                        assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                     )
                  ),
                  assign(s9, max(s9, nth(T16, V(0))))
               )
            )
         )
      ),
      assign(q6, s9)
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(nth(T11, V(0)), V(0.0)),
   loop(i17, [ 0 .. 2 ],
      decl([ T12 ],
         chain(
            decl([ T13, T14 ],
               chain(
                  assign(nth(T14, V(0)), nth(X, V(0))),
                  assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                  assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
               )
            ),
            assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
         )
      )
   ),
   assign(q5, nth(T11, V(0))),
   chain(
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            decl([ T16 ],
               chain(
                  decl([ T17 ],
                     chain(
                        loop(i18, [ 0 .. 1 ],
                           decl([ T18 ],
                              chain(
                                 assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                                 assign(nth(T17, i18), nth(T18, V(0)))
                              )
                           )
                        ),
                        assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                     )
                  ),
                  assign(s9, max(s9, nth(T16, V(0))))
               )
            )
         )
      ),
      assign(q6, s9)
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(nth(T11, V(0)), V(0.0)),
   loop(i17, [ 0 .. 2 ],
      decl([ T12 ],
         chain(
            decl([ T13, T14 ],
               chain(
                  assign(nth(T14, V(0)), nth(X, V(0))),
                  assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                  assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
               )
            ),
            assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
         )
      )
   ),
   chain(
      assign(q5, nth(T11, V(0))),
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            decl([ T16 ],
               chain(
                  decl([ T17 ],
                     chain(
                        loop(i18, [ 0 .. 1 ],
                           decl([ T18 ],
                              chain(
                                 assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                                 assign(nth(T17, i18), nth(T18, V(0)))
                              )
                           )
                        ),
                        assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                     )
                  ),
                  assign(s9, max(s9, nth(T16, V(0))))
               )
            )
         )
      ),
      assign(q6, s9)
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(nth(T11, V(0)), V(0.0)),
   loop(i17, [ 0 .. 2 ],
      decl([ T12 ],
         chain(
            decl([ T13, T14 ],
               chain(
                  assign(nth(T14, V(0)), nth(X, V(0))),
                  assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                  assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
               )
            ),
            assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
         )
      )
   ),
   chain(
      assign(q5, nth(T11, V(0))),
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            decl([ T16 ],
               chain(
                  decl([ T17 ],
                     chain(
                        loop(i18, [ 0 .. 1 ],
                           decl([ T18 ],
                              chain(
                                 assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                                 assign(nth(T17, i18), nth(T18, V(0)))
                              )
                           )
                        ),
                        assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                     )
                  ),
                  assign(s9, max(s9, nth(T16, V(0))))
               )
            )
         )
      ),
      assign(q6, s9)
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(nth(T11, V(0)), V(0.0)),
   chain(
      loop(i17, [ 0 .. 2 ],
         decl([ T12 ],
            chain(
               decl([ T13, T14 ],
                  chain(
                     assign(nth(T14, V(0)), nth(X, V(0))),
                     assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                     assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
                  )
               ),
               assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
            )
         )
      ),
      assign(q5, nth(T11, V(0))),
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            decl([ T16 ],
               chain(
                  decl([ T17 ],
                     chain(
                        loop(i18, [ 0 .. 1 ],
                           decl([ T18 ],
                              chain(
                                 assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                                 assign(nth(T17, i18), nth(T18, V(0)))
                              )
                           )
                        ),
                        assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                     )
                  ),
                  assign(s9, max(s9, nth(T16, V(0))))
               )
            )
         )
      ),
      assign(q6, s9)
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(nth(T11, V(0)), V(0.0)),
   chain(
      loop(i17, [ 0 .. 2 ],
         decl([ T12 ],
            chain(
               decl([ T13, T14 ],
                  chain(
                     assign(nth(T14, V(0)), nth(X, V(0))),
                     assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                     assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
                  )
               ),
               assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
            )
         )
      ),
      assign(q5, nth(T11, V(0))),
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            decl([ T16 ],
               chain(
                  decl([ T17 ],
                     chain(
                        loop(i18, [ 0 .. 1 ],
                           decl([ T18 ],
                              chain(
                                 assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                                 assign(nth(T17, i18), nth(T18, V(0)))
                              )
                           )
                        ),
                        assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                     )
                  ),
                  assign(s9, max(s9, nth(T16, V(0))))
               )
            )
         )
      ),
      assign(q6, s9)
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(nth(T11, V(0)), V(0.0)),
      loop(i17, [ 0 .. 2 ],
         decl([ T12 ],
            chain(
               decl([ T13, T14 ],
                  chain(
                     assign(nth(T14, V(0)), nth(X, V(0))),
                     assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                     assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
                  )
               ),
               assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
            )
         )
      ),
      assign(q5, nth(T11, V(0))),
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            decl([ T16 ],
               chain(
                  decl([ T17 ],
                     chain(
                        loop(i18, [ 0 .. 1 ],
                           decl([ T18 ],
                              chain(
                                 assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                                 assign(nth(T17, i18), nth(T18, V(0)))
                              )
                           )
                        ),
                        assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                     )
                  ),
                  assign(s9, max(s9, nth(T16, V(0))))
               )
            )
         )
      ),
      assign(q6, s9)
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(nth(T11, V(0)), V(0.0)),
   loop(i17, [ 0 .. 2 ],
      decl([ T12 ],
         chain(
            decl([ T13, T14 ],
               chain(
                  assign(nth(T14, V(0)), nth(X, V(0))),
                  assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                  assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
               )
            ),
            assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
         )
      )
   ),
   assign(q5, nth(T11, V(0))),
   chain(
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         decl([ T16 ],
            chain(
               decl([ T17 ],
                  chain(
                     loop(i18, [ 0 .. 1 ],
                        decl([ T18 ],
                           chain(
                              assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                              assign(nth(T17, i18), nth(T18, V(0)))
                           )
                        )
                     ),
                     assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                  )
               ),
               assign(s9, max(s9, nth(T16, V(0))))
            )
         )
      )
   ),
   assign(q6, s9)
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(nth(T11, V(0)), V(0.0)),
   loop(i17, [ 0 .. 2 ],
      decl([ T12 ],
         chain(
            decl([ T13, T14 ],
               chain(
                  assign(nth(T14, V(0)), nth(X, V(0))),
                  assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                  assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
               )
            ),
            assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
         )
      )
   ),
   chain(
      assign(q5, nth(T11, V(0))),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         decl([ T16 ],
            chain(
               decl([ T17 ],
                  chain(
                     loop(i18, [ 0 .. 1 ],
                        decl([ T18 ],
                           chain(
                              assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                              assign(nth(T17, i18), nth(T18, V(0)))
                           )
                        )
                     ),
                     assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                  )
               ),
               assign(s9, max(s9, nth(T16, V(0))))
            )
         )
      )
   ),
   assign(q6, s9)
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(nth(T11, V(0)), V(0.0)),
   loop(i17, [ 0 .. 2 ],
      decl([ T12 ],
         chain(
            decl([ T13, T14 ],
               chain(
                  assign(nth(T14, V(0)), nth(X, V(0))),
                  assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                  assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
               )
            ),
            assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
         )
      )
   ),
   chain(
      assign(q5, nth(T11, V(0))),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         decl([ T16 ],
            chain(
               decl([ T17 ],
                  chain(
                     loop(i18, [ 0 .. 1 ],
                        decl([ T18 ],
                           chain(
                              assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                              assign(nth(T17, i18), nth(T18, V(0)))
                           )
                        )
                     ),
                     assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                  )
               ),
               assign(s9, max(s9, nth(T16, V(0))))
            )
         )
      )
   ),
   assign(q6, s9)
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(nth(T11, V(0)), V(0.0)),
   chain(
      loop(i17, [ 0 .. 2 ],
         decl([ T12 ],
            chain(
               decl([ T13, T14 ],
                  chain(
                     assign(nth(T14, V(0)), nth(X, V(0))),
                     assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                     assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
                  )
               ),
               assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
            )
         )
      ),
      assign(q5, nth(T11, V(0))),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         decl([ T16 ],
            chain(
               decl([ T17 ],
                  chain(
                     loop(i18, [ 0 .. 1 ],
                        decl([ T18 ],
                           chain(
                              assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                              assign(nth(T17, i18), nth(T18, V(0)))
                           )
                        )
                     ),
                     assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                  )
               ),
               assign(s9, max(s9, nth(T16, V(0))))
            )
         )
      )
   ),
   assign(q6, s9)
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(nth(T11, V(0)), V(0.0)),
   chain(
      loop(i17, [ 0 .. 2 ],
         decl([ T12 ],
            chain(
               decl([ T13, T14 ],
                  chain(
                     assign(nth(T14, V(0)), nth(X, V(0))),
                     assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                     assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
                  )
               ),
               assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
            )
         )
      ),
      assign(q5, nth(T11, V(0))),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         decl([ T16 ],
            chain(
               decl([ T17 ],
                  chain(
                     loop(i18, [ 0 .. 1 ],
                        decl([ T18 ],
                           chain(
                              assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                              assign(nth(T17, i18), nth(T18, V(0)))
                           )
                        )
                     ),
                     assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                  )
               ),
               assign(s9, max(s9, nth(T16, V(0))))
            )
         )
      )
   ),
   assign(q6, s9)
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(nth(T11, V(0)), V(0.0)),
      loop(i17, [ 0 .. 2 ],
         decl([ T12 ],
            chain(
               decl([ T13, T14 ],
                  chain(
                     assign(nth(T14, V(0)), nth(X, V(0))),
                     assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                     assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
                  )
               ),
               assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
            )
         )
      ),
      assign(q5, nth(T11, V(0))),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         decl([ T16 ],
            chain(
               decl([ T17 ],
                  chain(
                     loop(i18, [ 0 .. 1 ],
                        decl([ T18 ],
                           chain(
                              assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                              assign(nth(T17, i18), nth(T18, V(0)))
                           )
                        )
                     ),
                     assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                  )
               ),
               assign(s9, max(s9, nth(T16, V(0))))
            )
         )
      )
   ),
   assign(q6, s9)
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain_xyz
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      assign(nth(T11, V(0)), V(0.0)),
      loop(i17, [ 0 .. 2 ],
         decl([ T12 ],
            chain(
               decl([ T13, T14 ],
                  chain(
                     assign(nth(T14, V(0)), nth(X, V(0))),
                     assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                     assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
                  )
               ),
               assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
            )
         )
      ),
      assign(q5, nth(T11, V(0))),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         decl([ T16 ],
            chain(
               decl([ T17 ],
                  chain(
                     loop(i18, [ 0 .. 1 ],
                        decl([ T18 ],
                           chain(
                              assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                              assign(nth(T17, i18), nth(T18, V(0)))
                           )
                        )
                     ),
                     assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                  )
               ),
               assign(s9, max(s9, nth(T16, V(0))))
            )
         )
      )
   ),
   assign(q6, s9)
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(nth(T11, V(0)), V(0.0)),
      loop(i17, [ 0 .. 2 ],
         decl([ T12 ],
            chain(
               decl([ T13, T14 ],
                  chain(
                     assign(nth(T14, V(0)), nth(X, V(0))),
                     assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                     assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
                  )
               ),
               assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
            )
         )
      ),
      assign(q5, nth(T11, V(0))),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         decl([ T16 ],
            chain(
               decl([ T17 ],
                  chain(
                     loop(i18, [ 0 .. 1 ],
                        decl([ T18 ],
                           chain(
                              assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                              assign(nth(T17, i18), nth(T18, V(0)))
                           )
                        )
                     ),
                     assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                  )
               ),
               assign(s9, max(s9, nth(T16, V(0))))
            )
         )
      ),
      assign(q6, s9)
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: loop_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
loop(i17, [ 0 .. 2 ],
   decl([ T12 ],
      chain(
         decl([ T13, T14 ],
            chain(
               assign(nth(T14, V(0)), nth(X, V(0))),
               assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
               assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
            )
         ),
         assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ T12 ],
   loop(i17, [ 0 .. 2 ],
      chain(
         decl([ T13, T14 ],
            chain(
               assign(nth(T14, V(0)), nth(X, V(0))),
               assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
               assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
            )
         ),
         assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   decl([ T13, T14 ],
      chain(
         assign(nth(T14, V(0)), nth(X, V(0))),
         assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
         assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
      )
   ),
   assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ T13, T14 ],
   chain(
      chain(
         assign(nth(T14, V(0)), nth(X, V(0))),
         assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
         assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
      ),
      assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      assign(nth(T14, V(0)), nth(X, V(0))),
      assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
      assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
   ),
   assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(nth(T14, V(0)), nth(X, V(0))),
   assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
   assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
   assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: loop_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
loop(i15, [ 0 .. 1 ],
   decl([ T16 ],
      chain(
         decl([ T17 ],
            chain(
               loop(i18, [ 0 .. 1 ],
                  decl([ T18 ],
                     chain(
                        assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                        assign(nth(T17, i18), nth(T18, V(0)))
                     )
                  )
               ),
               assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
            )
         ),
         assign(s9, max(s9, nth(T16, V(0))))
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ T16 ],
   loop(i15, [ 0 .. 1 ],
      chain(
         decl([ T17 ],
            chain(
               loop(i18, [ 0 .. 1 ],
                  decl([ T18 ],
                     chain(
                        assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                        assign(nth(T17, i18), nth(T18, V(0)))
                     )
                  )
               ),
               assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
            )
         ),
         assign(s9, max(s9, nth(T16, V(0))))
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   decl([ T17 ],
      chain(
         loop(i18, [ 0 .. 1 ],
            decl([ T18 ],
               chain(
                  assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                  assign(nth(T17, i18), nth(T18, V(0)))
               )
            )
         ),
         assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
      )
   ),
   assign(s9, max(s9, nth(T16, V(0))))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ T17 ],
   chain(
      chain(
         loop(i18, [ 0 .. 1 ],
            decl([ T18 ],
               chain(
                  assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                  assign(nth(T17, i18), nth(T18, V(0)))
               )
            )
         ),
         assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
      ),
      assign(s9, max(s9, nth(T16, V(0))))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      loop(i18, [ 0 .. 1 ],
         decl([ T18 ],
            chain(
               assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
               assign(nth(T17, i18), nth(T18, V(0)))
            )
         )
      ),
      assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
   ),
   assign(s9, max(s9, nth(T16, V(0))))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   loop(i18, [ 0 .. 1 ],
      decl([ T18 ],
         chain(
            assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
            assign(nth(T17, i18), nth(T18, V(0)))
         )
      )
   ),
   assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1))))),
   assign(s9, max(s9, nth(T16, V(0))))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unroll
------------------------------------------------------------------
old expression
------------------------------------------------------------------
loop(i18, [ 0 .. 1 ],
   decl([ T18 ],
      chain(
         assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
         assign(nth(T17, i18), nth(T18, V(0)))
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   decl([ T18 ],
      chain(
         assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), V(0))))),
         assign(nth(T17, V(0)), nth(T18, V(0)))
      )
   ),
   decl([ T18 ],
      chain(
         assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), V(1))))),
         assign(nth(T17, V(1)), nth(T18, V(0)))
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: scalarize1
------------------------------------------------------------------
old expression
------------------------------------------------------------------
decl([ T18 ],
   chain(
      assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), V(0))))),
      assign(nth(T17, V(0)), nth(T18, V(0)))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T18, V(0))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
s10
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T18, V(0))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
s10
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ s10 ],
   chain(
      assign(s10, nth(X, add(i15, V(1)))),
      assign(nth(T17, V(0)), s10)
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: assign_var_var
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(s10, nth(X, add(i15, V(1)))),
   assign(nth(T17, V(0)), s10)
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: scalarize1
------------------------------------------------------------------
old expression
------------------------------------------------------------------
decl([ T18 ],
   chain(
      assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), V(1))))),
      assign(nth(T17, V(1)), nth(T18, V(0)))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T18, V(0))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
s11
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T18, V(0))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
s11
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ s11 ],
   chain(
      assign(s11, nth(X, add(add(i15, V(1)), V(2)))),
      assign(nth(T17, V(1)), s11)
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: assign_var_var
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(s11, nth(X, add(add(i15, V(1)), V(2)))),
   assign(nth(T17, V(1)), s11)
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(nth(T17, V(1)), nth(X, add(add(i15, V(1)), V(2))))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: add_assoc
------------------------------------------------------------------
old expression
------------------------------------------------------------------
add(add(i15, V(1)), V(2))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
add(V(3), i15)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: abs_cond
------------------------------------------------------------------
old expression
------------------------------------------------------------------
assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ w2 ],
   chain(
      assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
      assign(nth(T16, V(0)), cond(geq(w2, V(0)), w2, neg(w2)))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: max_cond
------------------------------------------------------------------
old expression
------------------------------------------------------------------
max(s9, nth(T16, V(0)))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
cond(geq(s9, nth(T16, V(0))), s9, nth(T16, V(0)))
------------------------------------------------------------------

------------------------------------------------------------------
RULE: Y0_creturn
------------------------------------------------------------------
old expression
------------------------------------------------------------------
assign(nth(Y, V(0)), geq(q6, q5))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
creturn(geq(q6, q5))
------------------------------------------------------------------

------------------------------------------------------------------
RULE: copyprop_var_var
------------------------------------------------------------------
old expression
------------------------------------------------------------------
decl([ q5, q6 ],
   chain(
      decl([ s9 ],
         decl([ T11 ],
            chain(
               chain(
                  chain(
                     assign(nth(T11, V(0)), V(0.0)),
                     decl([ T12 ],
                        loop(i17, [ 0 .. 2 ],
                           decl([ T13, T14 ],
                              chain(
                                 assign(nth(T14, V(0)), nth(X, V(0))),
                                 assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                                 assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                                 assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                              )
                           )
                        )
                     ),
                     assign(q5, nth(T11, V(0))),
                     assign(s9, V(0.0)),
                     decl([ T16 ],
                        loop(i15, [ 0 .. 1 ],
                           decl([ T17 ],
                              chain(
                                 chain(
                                    decl([ s10 ],
                                       chain(
                                          assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                                       )
                                    ),
                                    decl([ s11 ],
                                       chain(
                                          assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                                       )
                                    )
                                 ),
                                 decl([ w2 ],
                                    chain(
                                       assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                                       assign(nth(T16, V(0)), cond(geq(w2, V(0)), w2, neg(w2)))
                                    )
                                 ),
                                 assign(s9, cond(geq(s9, nth(T16, V(0))), s9, nth(T16, V(0))))
                              )
                           )
                        )
                     ),
                     assign(q6, s9)
                  )
               )
            )
         )
      ),
      creturn(geq(q6, q5))
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ q5 ],
   chain(
      decl([ s9 ],
         decl([ T11 ],
            chain(
               chain(
                  chain(
                     assign(nth(T11, V(0)), V(0.0)),
                     decl([ T12 ],
                        loop(i17, [ 0 .. 2 ],
                           decl([ T13, T14 ],
                              chain(
                                 assign(nth(T14, V(0)), nth(X, V(0))),
                                 assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                                 assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                                 assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                              )
                           )
                        )
                     ),
                     assign(q5, nth(T11, V(0))),
                     assign(s9, V(0.0)),
                     decl([ T16 ],
                        loop(i15, [ 0 .. 1 ],
                           decl([ T17 ],
                              chain(
                                 chain(
                                    decl([ s10 ],
                                       chain(
                                          assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                                       )
                                    ),
                                    decl([ s11 ],
                                       chain(
                                          assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                                       )
                                    )
                                 ),
                                 decl([ w2 ],
                                    chain(
                                       assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                                       assign(nth(T16, V(0)), cond(geq(w2, V(0)), w2, neg(w2)))
                                    )
                                 ),
                                 assign(s9, cond(geq(s9, nth(T16, V(0))), s9, nth(T16, V(0))))
                              )
                           )
                        )
                     ),
                     assign(s9, s9)
                  )
               )
            )
         )
      ),
      creturn(geq(s9, q5))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   decl([ s9 ],
      decl([ T11 ],
         chain(
            chain(
               chain(
                  assign(nth(T11, V(0)), V(0.0)),
                  decl([ T12 ],
                     loop(i17, [ 0 .. 2 ],
                        decl([ T13, T14 ],
                           chain(
                              assign(nth(T14, V(0)), nth(X, V(0))),
                              assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                              assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                              assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                           )
                        )
                     )
                  ),
                  assign(q5, nth(T11, V(0))),
                  assign(s9, V(0.0)),
                  decl([ T16 ],
                     loop(i15, [ 0 .. 1 ],
                        decl([ T17 ],
                           chain(
                              chain(
                                 decl([ s10 ],
                                    chain(
                                       assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                                    )
                                 ),
                                 decl([ s11 ],
                                    chain(
                                       assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                                    )
                                 )
                              ),
                              decl([ w2 ],
                                 chain(
                                    assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                                    assign(nth(T16, V(0)), cond(geq(w2, V(0)), w2, neg(w2)))
                                 )
                              ),
                              assign(s9, cond(geq(s9, nth(T16, V(0))), s9, nth(T16, V(0))))
                           )
                        )
                     )
                  ),
                  assign(s9, s9)
               )
            )
         )
      )
   ),
   creturn(geq(s9, q5))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ s9 ],
   chain(
      decl([ T11 ],
         chain(
            chain(
               chain(
                  assign(nth(T11, V(0)), V(0.0)),
                  decl([ T12 ],
                     loop(i17, [ 0 .. 2 ],
                        decl([ T13, T14 ],
                           chain(
                              assign(nth(T14, V(0)), nth(X, V(0))),
                              assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                              assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                              assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                           )
                        )
                     )
                  ),
                  assign(q5, nth(T11, V(0))),
                  assign(s9, V(0.0)),
                  decl([ T16 ],
                     loop(i15, [ 0 .. 1 ],
                        decl([ T17 ],
                           chain(
                              chain(
                                 decl([ s10 ],
                                    chain(
                                       assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                                    )
                                 ),
                                 decl([ s11 ],
                                    chain(
                                       assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                                    )
                                 )
                              ),
                              decl([ w2 ],
                                 chain(
                                    assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                                    assign(nth(T16, V(0)), cond(geq(w2, V(0)), w2, neg(w2)))
                                 )
                              ),
                              assign(s9, cond(geq(s9, nth(T16, V(0))), s9, nth(T16, V(0))))
                           )
                        )
                     )
                  ),
                  assign(s9, s9)
               )
            )
         )
      ),
      creturn(geq(s9, q5))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   decl([ T11 ],
      chain(
         chain(
            chain(
               assign(nth(T11, V(0)), V(0.0)),
               decl([ T12 ],
                  loop(i17, [ 0 .. 2 ],
                     decl([ T13, T14 ],
                        chain(
                           assign(nth(T14, V(0)), nth(X, V(0))),
                           assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                           assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                           assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                        )
                     )
                  )
               ),
               assign(q5, nth(T11, V(0))),
               assign(s9, V(0.0)),
               decl([ T16 ],
                  loop(i15, [ 0 .. 1 ],
                     decl([ T17 ],
                        chain(
                           chain(
                              decl([ s10 ],
                                 chain(
                                    assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                                 )
                              ),
                              decl([ s11 ],
                                 chain(
                                    assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                                 )
                              )
                           ),
                           decl([ w2 ],
                              chain(
                                 assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                                 assign(nth(T16, V(0)), cond(geq(w2, V(0)), w2, neg(w2)))
                              )
                           ),
                           assign(s9, cond(geq(s9, nth(T16, V(0))), s9, nth(T16, V(0))))
                        )
                     )
                  )
               ),
               assign(s9, s9)
            )
         )
      )
   ),
   creturn(geq(s9, q5))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ T11 ],
   chain(
      chain(
         chain(
            chain(
               assign(nth(T11, V(0)), V(0.0)),
               decl([ T12 ],
                  loop(i17, [ 0 .. 2 ],
                     decl([ T13, T14 ],
                        chain(
                           assign(nth(T14, V(0)), nth(X, V(0))),
                           assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                           assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                           assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                        )
                     )
                  )
               ),
               assign(q5, nth(T11, V(0))),
               assign(s9, V(0.0)),
               decl([ T16 ],
                  loop(i15, [ 0 .. 1 ],
                     decl([ T17 ],
                        chain(
                           chain(
                              decl([ s10 ],
                                 chain(
                                    assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                                 )
                              ),
                              decl([ s11 ],
                                 chain(
                                    assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                                 )
                              )
                           ),
                           decl([ w2 ],
                              chain(
                                 assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                                 assign(nth(T16, V(0)), cond(geq(w2, V(0)), w2, neg(w2)))
                              )
                           ),
                           assign(s9, cond(geq(s9, nth(T16, V(0))), s9, nth(T16, V(0))))
                        )
                     )
                  )
               ),
               assign(s9, s9)
            )
         )
      ),
      creturn(geq(s9, q5))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      chain(
         chain(
            assign(nth(T11, V(0)), V(0.0)),
            decl([ T12 ],
               loop(i17, [ 0 .. 2 ],
                  decl([ T13, T14 ],
                     chain(
                        assign(nth(T14, V(0)), nth(X, V(0))),
                        assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                        assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                        assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                     )
                  )
               )
            ),
            assign(q5, nth(T11, V(0))),
            assign(s9, V(0.0)),
            decl([ T16 ],
               loop(i15, [ 0 .. 1 ],
                  decl([ T17 ],
                     chain(
                        chain(
                           decl([ s10 ],
                              chain(
                                 assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                              )
                           ),
                           decl([ s11 ],
                              chain(
                                 assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                              )
                           )
                        ),
                        decl([ w2 ],
                           chain(
                              assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                              assign(nth(T16, V(0)), cond(geq(w2, V(0)), w2, neg(w2)))
                           )
                        ),
                        assign(s9, cond(geq(s9, nth(T16, V(0))), s9, nth(T16, V(0))))
                     )
                  )
               )
            ),
            assign(s9, s9)
         )
      )
   ),
   creturn(geq(s9, q5))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      chain(
         assign(nth(T11, V(0)), V(0.0)),
         decl([ T12 ],
            loop(i17, [ 0 .. 2 ],
               decl([ T13, T14 ],
                  chain(
                     assign(nth(T14, V(0)), nth(X, V(0))),
                     assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                     assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                     assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                  )
               )
            )
         ),
         assign(q5, nth(T11, V(0))),
         assign(s9, V(0.0)),
         decl([ T16 ],
            loop(i15, [ 0 .. 1 ],
               decl([ T17 ],
                  chain(
                     chain(
                        decl([ s10 ],
                           chain(
                              assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                           )
                        ),
                        decl([ s11 ],
                           chain(
                              assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                           )
                        )
                     ),
                     decl([ w2 ],
                        chain(
                           assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                           assign(nth(T16, V(0)), cond(geq(w2, V(0)), w2, neg(w2)))
                        )
                     ),
                     assign(s9, cond(geq(s9, nth(T16, V(0))), s9, nth(T16, V(0))))
                  )
               )
            )
         ),
         assign(s9, s9)
      )
   ),
   creturn(geq(s9, q5))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      chain(
         assign(nth(T11, V(0)), V(0.0)),
         decl([ T12 ],
            loop(i17, [ 0 .. 2 ],
               decl([ T13, T14 ],
                  chain(
                     assign(nth(T14, V(0)), nth(X, V(0))),
                     assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                     assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                     assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                  )
               )
            )
         ),
         assign(q5, nth(T11, V(0))),
         assign(s9, V(0.0)),
         decl([ T16 ],
            loop(i15, [ 0 .. 1 ],
               decl([ T17 ],
                  chain(
                     chain(
                        decl([ s10 ],
                           chain(
                              assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                           )
                        ),
                        decl([ s11 ],
                           chain(
                              assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                           )
                        )
                     ),
                     decl([ w2 ],
                        chain(
                           assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                           assign(nth(T16, V(0)), cond(geq(w2, V(0)), w2, neg(w2)))
                        )
                     ),
                     assign(s9, cond(geq(s9, nth(T16, V(0))), s9, nth(T16, V(0))))
                  )
               )
            )
         ),
         assign(s9, s9)
      )
   ),
   creturn(geq(s9, q5))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(nth(T11, V(0)), V(0.0)),
      decl([ T12 ],
         loop(i17, [ 0 .. 2 ],
            decl([ T13, T14 ],
               chain(
                  assign(nth(T14, V(0)), nth(X, V(0))),
                  assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                  assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                  assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
               )
            )
         )
      ),
      assign(q5, nth(T11, V(0))),
      assign(s9, V(0.0)),
      decl([ T16 ],
         loop(i15, [ 0 .. 1 ],
            decl([ T17 ],
               chain(
                  chain(
                     decl([ s10 ],
                        chain(
                           assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                        )
                     ),
                     decl([ s11 ],
                        chain(
                           assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                        )
                     )
                  ),
                  decl([ w2 ],
                     chain(
                        assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                        assign(nth(T16, V(0)), cond(geq(w2, V(0)), w2, neg(w2)))
                     )
                  ),
                  assign(s9, cond(geq(s9, nth(T16, V(0))), s9, nth(T16, V(0))))
               )
            )
         )
      ),
      assign(s9, s9)
   ),
   creturn(geq(s9, q5))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      assign(nth(T11, V(0)), V(0.0)),
      decl([ T12 ],
         loop(i17, [ 0 .. 2 ],
            decl([ T13, T14 ],
               chain(
                  assign(nth(T14, V(0)), nth(X, V(0))),
                  assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                  assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                  assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
               )
            )
         )
      ),
      assign(q5, nth(T11, V(0))),
      assign(s9, V(0.0)),
      decl([ T16 ],
         loop(i15, [ 0 .. 1 ],
            decl([ T17 ],
               chain(
                  chain(
                     decl([ s10 ],
                        chain(
                           assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                        )
                     ),
                     decl([ s11 ],
                        chain(
                           assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                        )
                     )
                  ),
                  decl([ w2 ],
                     chain(
                        assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                        assign(nth(T16, V(0)), cond(geq(w2, V(0)), w2, neg(w2)))
                     )
                  ),
                  assign(s9, cond(geq(s9, nth(T16, V(0))), s9, nth(T16, V(0))))
               )
            )
         )
      ),
      assign(s9, s9)
   ),
   creturn(geq(s9, q5))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(nth(T11, V(0)), V(0.0)),
   decl([ T12 ],
      loop(i17, [ 0 .. 2 ],
         decl([ T13, T14 ],
            chain(
               assign(nth(T14, V(0)), nth(X, V(0))),
               assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
               assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
               assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
            )
         )
      )
   ),
   assign(q5, nth(T11, V(0))),
   assign(s9, V(0.0)),
   decl([ T16 ],
      loop(i15, [ 0 .. 1 ],
         decl([ T17 ],
            chain(
               chain(
                  decl([ s10 ],
                     chain(
                        assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                     )
                  ),
                  decl([ s11 ],
                     chain(
                        assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                     )
                  )
               ),
               decl([ w2 ],
                  chain(
                     assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                     assign(nth(T16, V(0)), cond(geq(w2, V(0)), w2, neg(w2)))
                  )
               ),
               assign(s9, cond(geq(s9, nth(T16, V(0))), s9, nth(T16, V(0))))
            )
         )
      )
   ),
   assign(s9, s9),
   creturn(geq(s9, q5))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(nth(T11, V(0)), V(0.0)),
   decl([ T12 ],
      loop(i17, [ 0 .. 2 ],
         decl([ T13, T14 ],
            chain(
               assign(nth(T14, V(0)), nth(X, V(0))),
               assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
               assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
               assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
            )
         )
      )
   ),
   assign(q5, nth(T11, V(0))),
   assign(s9, V(0.0)),
   decl([ T16 ],
      loop(i15, [ 0 .. 1 ],
         decl([ T17 ],
            chain(
               chain(
                  decl([ s10 ],
                     chain(
                        assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                     )
                  ),
                  decl([ s11 ],
                     chain(
                        assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                     )
                  )
               ),
               decl([ w2 ],
                  chain(
                     assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                     assign(nth(T16, V(0)), cond(geq(w2, V(0)), w2, neg(w2)))
                  )
               ),
               assign(s9, cond(geq(s9, nth(T16, V(0))), s9, nth(T16, V(0))))
            )
         )
      )
   ),
   assign(s9, s9),
   creturn(geq(s9, q5))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   decl([ T12 ],
      chain(
         assign(nth(T11, V(0)), V(0.0)),
         loop(i17, [ 0 .. 2 ],
            decl([ T13, T14 ],
               chain(
                  assign(nth(T14, V(0)), nth(X, V(0))),
                  assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                  assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                  assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
               )
            )
         )
      )
   ),
   assign(q5, nth(T11, V(0))),
   assign(s9, V(0.0)),
   decl([ T16 ],
      loop(i15, [ 0 .. 1 ],
         decl([ T17 ],
            chain(
               chain(
                  decl([ s10 ],
                     chain(
                        assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                     )
                  ),
                  decl([ s11 ],
                     chain(
                        assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                     )
                  )
               ),
               decl([ w2 ],
                  chain(
                     assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                     assign(nth(T16, V(0)), cond(geq(w2, V(0)), w2, neg(w2)))
                  )
               ),
               assign(s9, cond(geq(s9, nth(T16, V(0))), s9, nth(T16, V(0))))
            )
         )
      )
   ),
   assign(s9, s9),
   creturn(geq(s9, q5))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   decl([ T12 ],
      chain(
         assign(nth(T11, V(0)), V(0.0)),
         loop(i17, [ 0 .. 2 ],
            decl([ T13, T14 ],
               chain(
                  assign(nth(T14, V(0)), nth(X, V(0))),
                  assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                  assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                  assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
               )
            )
         )
      )
   ),
   assign(q5, nth(T11, V(0))),
   assign(s9, V(0.0)),
   decl([ T16 ],
      loop(i15, [ 0 .. 1 ],
         decl([ T17 ],
            chain(
               chain(
                  decl([ s10 ],
                     chain(
                        assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                     )
                  ),
                  decl([ s11 ],
                     chain(
                        assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                     )
                  )
               ),
               decl([ w2 ],
                  chain(
                     assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                     assign(nth(T16, V(0)), cond(geq(w2, V(0)), w2, neg(w2)))
                  )
               ),
               assign(s9, cond(geq(s9, nth(T16, V(0))), s9, nth(T16, V(0))))
            )
         )
      )
   ),
   assign(s9, s9),
   creturn(geq(s9, q5))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   decl([ T12 ],
      chain(
         assign(nth(T11, V(0)), V(0.0)),
         loop(i17, [ 0 .. 2 ],
            decl([ T13, T14 ],
               chain(
                  assign(nth(T14, V(0)), nth(X, V(0))),
                  assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                  assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                  assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
               )
            )
         )
      )
   ),
   assign(q5, nth(T11, V(0))),
   decl([ T16 ],
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            decl([ T17 ],
               chain(
                  chain(
                     decl([ s10 ],
                        chain(
                           assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                        )
                     ),
                     decl([ s11 ],
                        chain(
                           assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                        )
                     )
                  ),
                  decl([ w2 ],
                     chain(
                        assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                        assign(nth(T16, V(0)), cond(geq(w2, V(0)), w2, neg(w2)))
                     )
                  ),
                  assign(s9, cond(geq(s9, nth(T16, V(0))), s9, nth(T16, V(0))))
               )
            )
         )
      )
   ),
   assign(s9, s9),
   creturn(geq(s9, q5))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   decl([ T12 ],
      chain(
         assign(nth(T11, V(0)), V(0.0)),
         loop(i17, [ 0 .. 2 ],
            decl([ T13, T14 ],
               chain(
                  assign(nth(T14, V(0)), nth(X, V(0))),
                  assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                  assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                  assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
               )
            )
         )
      )
   ),
   assign(q5, nth(T11, V(0))),
   decl([ T16 ],
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            decl([ T17 ],
               chain(
                  chain(
                     decl([ s10 ],
                        chain(
                           assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                        )
                     ),
                     decl([ s11 ],
                        chain(
                           assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                        )
                     )
                  ),
                  decl([ w2 ],
                     chain(
                        assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                        assign(nth(T16, V(0)), cond(geq(w2, V(0)), w2, neg(w2)))
                     )
                  ),
                  assign(s9, cond(geq(s9, nth(T16, V(0))), s9, nth(T16, V(0))))
               )
            )
         )
      )
   ),
   assign(s9, s9),
   creturn(geq(s9, q5))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   decl([ T12 ],
      chain(
         assign(nth(T11, V(0)), V(0.0)),
         loop(i17, [ 0 .. 2 ],
            decl([ T13, T14 ],
               chain(
                  assign(nth(T14, V(0)), nth(X, V(0))),
                  assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                  assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                  assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
               )
            )
         )
      )
   ),
   decl([ T16 ],
      chain(
         assign(q5, nth(T11, V(0))),
         chain(
            assign(s9, V(0.0)),
            loop(i15, [ 0 .. 1 ],
               decl([ T17 ],
                  chain(
                     chain(
                        decl([ s10 ],
                           chain(
                              assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                           )
                        ),
                        decl([ s11 ],
                           chain(
                              assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                           )
                        )
                     ),
                     decl([ w2 ],
                        chain(
                           assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                           assign(nth(T16, V(0)), cond(geq(w2, V(0)), w2, neg(w2)))
                        )
                     ),
                     assign(s9, cond(geq(s9, nth(T16, V(0))), s9, nth(T16, V(0))))
                  )
               )
            )
         )
      )
   ),
   assign(s9, s9),
   creturn(geq(s9, q5))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   decl([ T12 ],
      chain(
         assign(nth(T11, V(0)), V(0.0)),
         loop(i17, [ 0 .. 2 ],
            decl([ T13, T14 ],
               chain(
                  assign(nth(T14, V(0)), nth(X, V(0))),
                  assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                  assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                  assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
               )
            )
         )
      )
   ),
   decl([ T16 ],
      chain(
         assign(q5, nth(T11, V(0))),
         chain(
            assign(s9, V(0.0)),
            loop(i15, [ 0 .. 1 ],
               decl([ T17 ],
                  chain(
                     chain(
                        decl([ s10 ],
                           chain(
                              assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                           )
                        ),
                        decl([ s11 ],
                           chain(
                              assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                           )
                        )
                     ),
                     decl([ w2 ],
                        chain(
                           assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                           assign(nth(T16, V(0)), cond(geq(w2, V(0)), w2, neg(w2)))
                        )
                     ),
                     assign(s9, cond(geq(s9, nth(T16, V(0))), s9, nth(T16, V(0))))
                  )
               )
            )
         )
      )
   ),
   assign(s9, s9),
   creturn(geq(s9, q5))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   decl([ T16 ],
      chain(
         decl([ T12 ],
            chain(
               assign(nth(T11, V(0)), V(0.0)),
               loop(i17, [ 0 .. 2 ],
                  decl([ T13, T14 ],
                     chain(
                        assign(nth(T14, V(0)), nth(X, V(0))),
                        assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                        assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                        assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                     )
                  )
               )
            )
         ),
         chain(
            assign(q5, nth(T11, V(0))),
            chain(
               assign(s9, V(0.0)),
               loop(i15, [ 0 .. 1 ],
                  decl([ T17 ],
                     chain(
                        chain(
                           decl([ s10 ],
                              chain(
                                 assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                              )
                           ),
                           decl([ s11 ],
                              chain(
                                 assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                              )
                           )
                        ),
                        decl([ w2 ],
                           chain(
                              assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                              assign(nth(T16, V(0)), cond(geq(w2, V(0)), w2, neg(w2)))
                           )
                        ),
                        assign(s9, cond(geq(s9, nth(T16, V(0))), s9, nth(T16, V(0))))
                     )
                  )
               )
            )
         )
      )
   ),
   assign(s9, s9),
   creturn(geq(s9, q5))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: drop_selfassign
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   decl([ T16 ],
      chain(
         decl([ T12 ],
            chain(
               assign(nth(T11, V(0)), V(0.0)),
               loop(i17, [ 0 .. 2 ],
                  decl([ T13, T14 ],
                     chain(
                        assign(nth(T14, V(0)), nth(X, V(0))),
                        assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                        assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                        assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                     )
                  )
               )
            )
         ),
         chain(
            assign(q5, nth(T11, V(0))),
            chain(
               assign(s9, V(0.0)),
               loop(i15, [ 0 .. 1 ],
                  decl([ T17 ],
                     chain(
                        chain(
                           decl([ s10 ],
                              chain(
                                 assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                              )
                           ),
                           decl([ s11 ],
                              chain(
                                 assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                              )
                           )
                        ),
                        decl([ w2 ],
                           chain(
                              assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                              assign(nth(T16, V(0)), cond(geq(w2, V(0)), w2, neg(w2)))
                           )
                        ),
                        assign(s9, cond(geq(s9, nth(T16, V(0))), s9, nth(T16, V(0))))
                     )
                  )
               )
            )
         )
      )
   ),
   assign(s9, s9),
   creturn(geq(s9, q5))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   decl([ T16 ],
      chain(
         decl([ T12 ],
            chain(
               assign(nth(T11, V(0)), V(0.0)),
               loop(i17, [ 0 .. 2 ],
                  decl([ T13, T14 ],
                     chain(
                        assign(nth(T14, V(0)), nth(X, V(0))),
                        assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                        assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                        assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                     )
                  )
               )
            )
         ),
         chain(
            assign(q5, nth(T11, V(0))),
            chain(
               assign(s9, V(0.0)),
               loop(i15, [ 0 .. 1 ],
                  decl([ T17 ],
                     chain(
                        chain(
                           decl([ s10 ],
                              chain(
                                 assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                              )
                           ),
                           decl([ s11 ],
                              chain(
                                 assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                              )
                           )
                        ),
                        decl([ w2 ],
                           chain(
                              assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                              assign(nth(T16, V(0)), cond(geq(w2, V(0)), w2, neg(w2)))
                           )
                        ),
                        assign(s9, cond(geq(s9, nth(T16, V(0))), s9, nth(T16, V(0))))
                     )
                  )
               )
            )
         )
      )
   ),
   creturn(geq(s9, q5))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: scalarize1
------------------------------------------------------------------
old expression
------------------------------------------------------------------
decl([ T16 ],
   chain(
      decl([ T12 ],
         chain(
            assign(nth(T11, V(0)), V(0.0)),
            loop(i17, [ 0 .. 2 ],
               decl([ T13, T14 ],
                  chain(
                     assign(nth(T14, V(0)), nth(X, V(0))),
                     assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                     assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                     assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                  )
               )
            )
         )
      ),
      chain(
         assign(q5, nth(T11, V(0))),
         chain(
            assign(s9, V(0.0)),
            loop(i15, [ 0 .. 1 ],
               decl([ T17 ],
                  chain(
                     chain(
                        decl([ s10 ],
                           chain(
                              assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                           )
                        ),
                        decl([ s11 ],
                           chain(
                              assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                           )
                        )
                     ),
                     decl([ w2 ],
                        chain(
                           assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                           assign(nth(T16, V(0)), cond(geq(w2, V(0)), w2, neg(w2)))
                        )
                     ),
                     assign(s9, cond(geq(s9, nth(T16, V(0))), s9, nth(T16, V(0))))
                  )
               )
            )
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T16, V(0))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
s12
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T16, V(0))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
s12
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T16, V(0))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
s12
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ s12 ],
   chain(
      decl([ T12 ],
         chain(
            assign(nth(T11, V(0)), V(0.0)),
            loop(i17, [ 0 .. 2 ],
               decl([ T13, T14 ],
                  chain(
                     assign(nth(T14, V(0)), nth(X, V(0))),
                     assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                     assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                     assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                  )
               )
            )
         )
      ),
      chain(
         assign(q5, nth(T11, V(0))),
         chain(
            assign(s9, V(0.0)),
            loop(i15, [ 0 .. 1 ],
               decl([ T17 ],
                  chain(
                     chain(
                        decl([ s10 ],
                           chain(
                              assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                           )
                        ),
                        decl([ s11 ],
                           chain(
                              assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                           )
                        )
                     ),
                     decl([ w2 ],
                        chain(
                           assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                           assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                        )
                     ),
                     assign(s9, cond(geq(s9, s12), s9, s12))
                  )
               )
            )
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   decl([ T12 ],
      chain(
         assign(nth(T11, V(0)), V(0.0)),
         loop(i17, [ 0 .. 2 ],
            decl([ T13, T14 ],
               chain(
                  assign(nth(T14, V(0)), nth(X, V(0))),
                  assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                  assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                  assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
               )
            )
         )
      )
   ),
   chain(
      assign(q5, nth(T11, V(0))),
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            decl([ T17 ],
               chain(
                  chain(
                     decl([ s10 ],
                        chain(
                           assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                        )
                     ),
                     decl([ s11 ],
                        chain(
                           assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                        )
                     )
                  ),
                  decl([ w2 ],
                     chain(
                        assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                        assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                     )
                  ),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ T12 ],
   chain(
      chain(
         assign(nth(T11, V(0)), V(0.0)),
         loop(i17, [ 0 .. 2 ],
            decl([ T13, T14 ],
               chain(
                  assign(nth(T14, V(0)), nth(X, V(0))),
                  assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                  assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                  assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
               )
            )
         )
      ),
      chain(
         assign(q5, nth(T11, V(0))),
         chain(
            assign(s9, V(0.0)),
            loop(i15, [ 0 .. 1 ],
               decl([ T17 ],
                  chain(
                     chain(
                        decl([ s10 ],
                           chain(
                              assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                           )
                        ),
                        decl([ s11 ],
                           chain(
                              assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                           )
                        )
                     ),
                     decl([ w2 ],
                        chain(
                           assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                           assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                        )
                     ),
                     assign(s9, cond(geq(s9, s12), s9, s12))
                  )
               )
            )
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      assign(nth(T11, V(0)), V(0.0)),
      loop(i17, [ 0 .. 2 ],
         decl([ T13, T14 ],
            chain(
               assign(nth(T14, V(0)), nth(X, V(0))),
               assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
               assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
               assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
            )
         )
      )
   ),
   chain(
      assign(q5, nth(T11, V(0))),
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            decl([ T17 ],
               chain(
                  chain(
                     decl([ s10 ],
                        chain(
                           assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                        )
                     ),
                     decl([ s11 ],
                        chain(
                           assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                        )
                     )
                  ),
                  decl([ w2 ],
                     chain(
                        assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                        assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                     )
                  ),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(nth(T11, V(0)), V(0.0)),
   loop(i17, [ 0 .. 2 ],
      decl([ T13, T14 ],
         chain(
            assign(nth(T14, V(0)), nth(X, V(0))),
            assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
            assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
            assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
         )
      )
   ),
   chain(
      assign(q5, nth(T11, V(0))),
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            decl([ T17 ],
               chain(
                  chain(
                     decl([ s10 ],
                        chain(
                           assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                        )
                     ),
                     decl([ s11 ],
                        chain(
                           assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                        )
                     )
                  ),
                  decl([ w2 ],
                     chain(
                        assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                        assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                     )
                  ),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(nth(T11, V(0)), V(0.0)),
   loop(i17, [ 0 .. 2 ],
      decl([ T13, T14 ],
         chain(
            assign(nth(T14, V(0)), nth(X, V(0))),
            assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
            assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
            assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
         )
      )
   ),
   chain(
      assign(q5, nth(T11, V(0))),
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            decl([ T17 ],
               chain(
                  chain(
                     decl([ s10 ],
                        chain(
                           assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                        )
                     ),
                     decl([ s11 ],
                        chain(
                           assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                        )
                     )
                  ),
                  decl([ w2 ],
                     chain(
                        assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                        assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                     )
                  ),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(nth(T11, V(0)), V(0.0)),
   chain(
      loop(i17, [ 0 .. 2 ],
         decl([ T13, T14 ],
            chain(
               assign(nth(T14, V(0)), nth(X, V(0))),
               assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
               assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
               assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
            )
         )
      ),
      assign(q5, nth(T11, V(0))),
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            decl([ T17 ],
               chain(
                  chain(
                     decl([ s10 ],
                        chain(
                           assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                        )
                     ),
                     decl([ s11 ],
                        chain(
                           assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                        )
                     )
                  ),
                  decl([ w2 ],
                     chain(
                        assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                        assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                     )
                  ),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(nth(T11, V(0)), V(0.0)),
   chain(
      loop(i17, [ 0 .. 2 ],
         decl([ T13, T14 ],
            chain(
               assign(nth(T14, V(0)), nth(X, V(0))),
               assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
               assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
               assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
            )
         )
      ),
      assign(q5, nth(T11, V(0))),
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            decl([ T17 ],
               chain(
                  chain(
                     decl([ s10 ],
                        chain(
                           assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                        )
                     ),
                     decl([ s11 ],
                        chain(
                           assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                        )
                     )
                  ),
                  decl([ w2 ],
                     chain(
                        assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                        assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                     )
                  ),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(nth(T11, V(0)), V(0.0)),
      loop(i17, [ 0 .. 2 ],
         decl([ T13, T14 ],
            chain(
               assign(nth(T14, V(0)), nth(X, V(0))),
               assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
               assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
               assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
            )
         )
      ),
      assign(q5, nth(T11, V(0))),
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            decl([ T17 ],
               chain(
                  chain(
                     decl([ s10 ],
                        chain(
                           assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                        )
                     ),
                     decl([ s11 ],
                        chain(
                           assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                        )
                     )
                  ),
                  decl([ w2 ],
                     chain(
                        assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                        assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                     )
                  ),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(nth(T11, V(0)), V(0.0)),
   loop(i17, [ 0 .. 2 ],
      decl([ T13, T14 ],
         chain(
            assign(nth(T14, V(0)), nth(X, V(0))),
            assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
            assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
            assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
         )
      )
   ),
   assign(q5, nth(T11, V(0))),
   chain(
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         decl([ T17 ],
            chain(
               chain(
                  decl([ s10 ],
                     chain(
                        assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                     )
                  ),
                  decl([ s11 ],
                     chain(
                        assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                     )
                  )
               ),
               decl([ w2 ],
                  chain(
                     assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                     assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                  )
               ),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(nth(T11, V(0)), V(0.0)),
   loop(i17, [ 0 .. 2 ],
      decl([ T13, T14 ],
         chain(
            assign(nth(T14, V(0)), nth(X, V(0))),
            assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
            assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
            assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
         )
      )
   ),
   chain(
      assign(q5, nth(T11, V(0))),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         decl([ T17 ],
            chain(
               chain(
                  decl([ s10 ],
                     chain(
                        assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                     )
                  ),
                  decl([ s11 ],
                     chain(
                        assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                     )
                  )
               ),
               decl([ w2 ],
                  chain(
                     assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                     assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                  )
               ),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(nth(T11, V(0)), V(0.0)),
   loop(i17, [ 0 .. 2 ],
      decl([ T13, T14 ],
         chain(
            assign(nth(T14, V(0)), nth(X, V(0))),
            assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
            assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
            assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
         )
      )
   ),
   chain(
      assign(q5, nth(T11, V(0))),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         decl([ T17 ],
            chain(
               chain(
                  decl([ s10 ],
                     chain(
                        assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                     )
                  ),
                  decl([ s11 ],
                     chain(
                        assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                     )
                  )
               ),
               decl([ w2 ],
                  chain(
                     assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                     assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                  )
               ),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(nth(T11, V(0)), V(0.0)),
   chain(
      loop(i17, [ 0 .. 2 ],
         decl([ T13, T14 ],
            chain(
               assign(nth(T14, V(0)), nth(X, V(0))),
               assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
               assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
               assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
            )
         )
      ),
      assign(q5, nth(T11, V(0))),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         decl([ T17 ],
            chain(
               chain(
                  decl([ s10 ],
                     chain(
                        assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                     )
                  ),
                  decl([ s11 ],
                     chain(
                        assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                     )
                  )
               ),
               decl([ w2 ],
                  chain(
                     assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                     assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                  )
               ),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(nth(T11, V(0)), V(0.0)),
   chain(
      loop(i17, [ 0 .. 2 ],
         decl([ T13, T14 ],
            chain(
               assign(nth(T14, V(0)), nth(X, V(0))),
               assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
               assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
               assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
            )
         )
      ),
      assign(q5, nth(T11, V(0))),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         decl([ T17 ],
            chain(
               chain(
                  decl([ s10 ],
                     chain(
                        assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                     )
                  ),
                  decl([ s11 ],
                     chain(
                        assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                     )
                  )
               ),
               decl([ w2 ],
                  chain(
                     assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                     assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                  )
               ),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(nth(T11, V(0)), V(0.0)),
      loop(i17, [ 0 .. 2 ],
         decl([ T13, T14 ],
            chain(
               assign(nth(T14, V(0)), nth(X, V(0))),
               assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
               assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
               assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
            )
         )
      ),
      assign(q5, nth(T11, V(0))),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         decl([ T17 ],
            chain(
               chain(
                  decl([ s10 ],
                     chain(
                        assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                     )
                  ),
                  decl([ s11 ],
                     chain(
                        assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
                     )
                  )
               ),
               decl([ w2 ],
                  chain(
                     assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                     assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                  )
               ),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: loop_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
loop(i17, [ 0 .. 2 ],
   decl([ T13, T14 ],
      chain(
         assign(nth(T14, V(0)), nth(X, V(0))),
         assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
         assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
         assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ T13, T14 ],
   loop(i17, [ 0 .. 2 ],
      chain(
         assign(nth(T14, V(0)), nth(X, V(0))),
         assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
         assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
         assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: loop_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
loop(i15, [ 0 .. 1 ],
   decl([ T17 ],
      chain(
         chain(
            decl([ s10 ],
               chain(
                  assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
               )
            ),
            decl([ s11 ],
               chain(
                  assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
               )
            )
         ),
         decl([ w2 ],
            chain(
               assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
               assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
            )
         ),
         assign(s9, cond(geq(s9, s12), s9, s12))
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ T17 ],
   loop(i15, [ 0 .. 1 ],
      chain(
         chain(
            decl([ s10 ],
               chain(
                  assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
               )
            ),
            decl([ s11 ],
               chain(
                  assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
               )
            )
         ),
         decl([ w2 ],
            chain(
               assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
               assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
            )
         ),
         assign(s9, cond(geq(s9, s12), s9, s12))
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      decl([ s10 ],
         chain(
            assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
         )
      ),
      decl([ s11 ],
         chain(
            assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
         )
      )
   ),
   decl([ w2 ],
      chain(
         assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
         assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
      )
   ),
   assign(s9, cond(geq(s9, s12), s9, s12))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   decl([ s10 ],
      chain(
         assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
      )
   ),
   decl([ s11 ],
      chain(
         assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
      )
   ),
   decl([ w2 ],
      chain(
         assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
         assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
      )
   ),
   assign(s9, cond(geq(s9, s12), s9, s12))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   decl([ s10 ],
      chain(
         assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
      )
   ),
   decl([ s11 ],
      chain(
         assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
      )
   ),
   decl([ w2 ],
      chain(
         assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
         assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
      )
   ),
   assign(s9, cond(geq(s9, s12), s9, s12))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   decl([ s11 ],
      chain(
         decl([ s10 ],
            chain(
               assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
            )
         ),
         chain(
            assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
         )
      )
   ),
   decl([ w2 ],
      chain(
         assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
         assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
      )
   ),
   assign(s9, cond(geq(s9, s12), s9, s12))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   decl([ s11 ],
      chain(
         decl([ s10 ],
            chain(
               assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
            )
         ),
         chain(
            assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
         )
      )
   ),
   decl([ w2 ],
      chain(
         assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
         assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
      )
   ),
   assign(s9, cond(geq(s9, s12), s9, s12))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   decl([ w2 ],
      chain(
         decl([ s11 ],
            chain(
               decl([ s10 ],
                  chain(
                     assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                  )
               ),
               chain(
                  assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
               )
            )
         ),
         chain(
            assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
            assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
         )
      )
   ),
   assign(s9, cond(geq(s9, s12), s9, s12))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   decl([ s11 ],
      chain(
         decl([ s10 ],
            chain(
               assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
            )
         ),
         chain(
            assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
         )
      )
   ),
   chain(
      assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
      assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ s11 ],
   chain(
      chain(
         decl([ s10 ],
            chain(
               assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
            )
         ),
         chain(
            assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
         )
      ),
      chain(
         assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
         assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      decl([ s10 ],
         chain(
            assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
         )
      ),
      chain(
         assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
      )
   ),
   chain(
      assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
      assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   decl([ s10 ],
      chain(
         assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
      )
   ),
   chain(
      assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
   ),
   chain(
      assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
      assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   decl([ s10 ],
      chain(
         assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
      )
   ),
   chain(
      assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
   ),
   chain(
      assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
      assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      decl([ s10 ],
         chain(
            assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
         )
      ),
      assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
   ),
   chain(
      assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
      assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      decl([ s10 ],
         chain(
            assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
         )
      ),
      assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
   ),
   chain(
      assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
      assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      chain(
         decl([ s10 ],
            chain(
               assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
            )
         ),
         assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
      ),
      assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
      assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      decl([ s10 ],
         chain(
            assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
         )
      ),
      assign(nth(T17, V(1)), nth(X, add(V(3), i15)))
   ),
   assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
   assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   decl([ s10 ],
      chain(
         assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
      )
   ),
   assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
   assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
   assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: drop_unused
------------------------------------------------------------------
old expression
------------------------------------------------------------------
decl([ s10 ],
   chain(
      assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: decl_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
decl([ q5 ],
   decl([ s9 ],
      decl([ T11 ],
         chain(
            decl([ s12 ],
               decl([ T12 ],
                  chain(
                     chain(
                        chain(
                           assign(nth(T11, V(0)), V(0.0)),
                           decl([ T13, T14 ],
                              loop(i17, [ 0 .. 2 ],
                                 chain(
                                    assign(nth(T14, V(0)), nth(X, V(0))),
                                    assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                                    assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                                    assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                                 )
                              )
                           ),
                           assign(q5, nth(T11, V(0))),
                           assign(s9, V(0.0)),
                           decl([ T17 ],
                              loop(i15, [ 0 .. 1 ],
                                 chain(
                                    decl([ w2 ],
                                       decl([ s11 ],
                                          chain(
                                             chain(
                                                chain(
                                                   assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                                                ),
                                                assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                                                assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                                                assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                                             )
                                          )
                                       )
                                    ),
                                    assign(s9, cond(geq(s9, s12), s9, s12))
                                 )
                              )
                           )
                        )
                     )
                  )
               )
            ),
            creturn(geq(s9, q5))
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ q5, s9 ],
   decl([ T11 ],
      chain(
         decl([ s12 ],
            decl([ T12 ],
               chain(
                  chain(
                     chain(
                        assign(nth(T11, V(0)), V(0.0)),
                        decl([ T13, T14 ],
                           loop(i17, [ 0 .. 2 ],
                              chain(
                                 assign(nth(T14, V(0)), nth(X, V(0))),
                                 assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                                 assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                                 assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                              )
                           )
                        ),
                        assign(q5, nth(T11, V(0))),
                        assign(s9, V(0.0)),
                        decl([ T17 ],
                           loop(i15, [ 0 .. 1 ],
                              chain(
                                 decl([ w2 ],
                                    decl([ s11 ],
                                       chain(
                                          chain(
                                             chain(
                                                assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                                             ),
                                             assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                                             assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                                             assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                                          )
                                       )
                                    )
                                 ),
                                 assign(s9, cond(geq(s9, s12), s9, s12))
                              )
                           )
                        )
                     )
                  )
               )
            )
         ),
         creturn(geq(s9, q5))
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: decl_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
decl([ q5, s9 ],
   decl([ T11 ],
      chain(
         decl([ s12 ],
            decl([ T12 ],
               chain(
                  chain(
                     chain(
                        assign(nth(T11, V(0)), V(0.0)),
                        decl([ T13, T14 ],
                           loop(i17, [ 0 .. 2 ],
                              chain(
                                 assign(nth(T14, V(0)), nth(X, V(0))),
                                 assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                                 assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                                 assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                              )
                           )
                        ),
                        assign(q5, nth(T11, V(0))),
                        assign(s9, V(0.0)),
                        decl([ T17 ],
                           loop(i15, [ 0 .. 1 ],
                              chain(
                                 decl([ w2 ],
                                    decl([ s11 ],
                                       chain(
                                          chain(
                                             chain(
                                                assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                                             ),
                                             assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                                             assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                                             assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                                          )
                                       )
                                    )
                                 ),
                                 assign(s9, cond(geq(s9, s12), s9, s12))
                              )
                           )
                        )
                     )
                  )
               )
            )
         ),
         creturn(geq(s9, q5))
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ T11, q5, s9 ],
   chain(
      decl([ s12 ],
         decl([ T12 ],
            chain(
               chain(
                  chain(
                     assign(nth(T11, V(0)), V(0.0)),
                     decl([ T13, T14 ],
                        loop(i17, [ 0 .. 2 ],
                           chain(
                              assign(nth(T14, V(0)), nth(X, V(0))),
                              assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                              assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                              assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                           )
                        )
                     ),
                     assign(q5, nth(T11, V(0))),
                     assign(s9, V(0.0)),
                     decl([ T17 ],
                        loop(i15, [ 0 .. 1 ],
                           chain(
                              decl([ w2 ],
                                 decl([ s11 ],
                                    chain(
                                       chain(
                                          chain(
                                             assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                                          ),
                                          assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                                          assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                                          assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                                       )
                                    )
                                 )
                              ),
                              assign(s9, cond(geq(s9, s12), s9, s12))
                           )
                        )
                     )
                  )
               )
            )
         )
      ),
      creturn(geq(s9, q5))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: scalarize1
------------------------------------------------------------------
old expression
------------------------------------------------------------------
decl([ T11, q5, s9 ],
   chain(
      decl([ s12 ],
         decl([ T12 ],
            chain(
               chain(
                  chain(
                     assign(nth(T11, V(0)), V(0.0)),
                     decl([ T13, T14 ],
                        loop(i17, [ 0 .. 2 ],
                           chain(
                              assign(nth(T14, V(0)), nth(X, V(0))),
                              assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                              assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                              assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                           )
                        )
                     ),
                     assign(q5, nth(T11, V(0))),
                     assign(s9, V(0.0)),
                     decl([ T17 ],
                        loop(i15, [ 0 .. 1 ],
                           chain(
                              decl([ w2 ],
                                 decl([ s11 ],
                                    chain(
                                       chain(
                                          chain(
                                             assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                                          ),
                                          assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                                          assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                                          assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                                       )
                                    )
                                 )
                              ),
                              assign(s9, cond(geq(s9, s12), s9, s12))
                           )
                        )
                     )
                  )
               )
            )
         )
      ),
      creturn(geq(s9, q5))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T11, V(0))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
s13
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T11, V(0))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
s13
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T11, V(0))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
s13
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T11, V(0))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
s13
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ q5, s13, s9 ],
   chain(
      decl([ s12 ],
         decl([ T12 ],
            chain(
               chain(
                  chain(
                     assign(s13, V(0.0)),
                     decl([ T13, T14 ],
                        loop(i17, [ 0 .. 2 ],
                           chain(
                              assign(nth(T14, V(0)), nth(X, V(0))),
                              assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                              assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                              assign(s13, add(s13, nth(T12, V(0))))
                           )
                        )
                     ),
                     assign(q5, s13),
                     assign(s9, V(0.0)),
                     decl([ T17 ],
                        loop(i15, [ 0 .. 1 ],
                           chain(
                              decl([ w2 ],
                                 decl([ s11 ],
                                    chain(
                                       chain(
                                          chain(
                                             assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                                          ),
                                          assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                                          assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                                          assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                                       )
                                    )
                                 )
                              ),
                              assign(s9, cond(geq(s9, s12), s9, s12))
                           )
                        )
                     )
                  )
               )
            )
         )
      ),
      creturn(geq(s9, q5))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: copyprop_var_var
------------------------------------------------------------------
old expression
------------------------------------------------------------------
decl([ q5, s13, s9 ],
   chain(
      decl([ s12 ],
         decl([ T12 ],
            chain(
               chain(
                  chain(
                     assign(s13, V(0.0)),
                     decl([ T13, T14 ],
                        loop(i17, [ 0 .. 2 ],
                           chain(
                              assign(nth(T14, V(0)), nth(X, V(0))),
                              assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                              assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                              assign(s13, add(s13, nth(T12, V(0))))
                           )
                        )
                     ),
                     assign(q5, s13),
                     assign(s9, V(0.0)),
                     decl([ T17 ],
                        loop(i15, [ 0 .. 1 ],
                           chain(
                              decl([ w2 ],
                                 decl([ s11 ],
                                    chain(
                                       chain(
                                          chain(
                                             assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                                          ),
                                          assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                                          assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                                          assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                                       )
                                    )
                                 )
                              ),
                              assign(s9, cond(geq(s9, s12), s9, s12))
                           )
                        )
                     )
                  )
               )
            )
         )
      ),
      creturn(geq(s9, q5))
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ s13, s9 ],
   chain(
      decl([ s12 ],
         decl([ T12 ],
            chain(
               chain(
                  chain(
                     assign(s13, V(0.0)),
                     decl([ T13, T14 ],
                        loop(i17, [ 0 .. 2 ],
                           chain(
                              assign(nth(T14, V(0)), nth(X, V(0))),
                              assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                              assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                              assign(s13, add(s13, nth(T12, V(0))))
                           )
                        )
                     ),
                     assign(s13, s13),
                     assign(s9, V(0.0)),
                     decl([ T17 ],
                        loop(i15, [ 0 .. 1 ],
                           chain(
                              decl([ w2 ],
                                 decl([ s11 ],
                                    chain(
                                       chain(
                                          chain(
                                             assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                                          ),
                                          assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                                          assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                                          assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                                       )
                                    )
                                 )
                              ),
                              assign(s9, cond(geq(s9, s12), s9, s12))
                           )
                        )
                     )
                  )
               )
            )
         )
      ),
      creturn(geq(s9, s13))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   decl([ s12 ],
      decl([ T12 ],
         chain(
            chain(
               chain(
                  assign(s13, V(0.0)),
                  decl([ T13, T14 ],
                     loop(i17, [ 0 .. 2 ],
                        chain(
                           assign(nth(T14, V(0)), nth(X, V(0))),
                           assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                           assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                           assign(s13, add(s13, nth(T12, V(0))))
                        )
                     )
                  ),
                  assign(s13, s13),
                  assign(s9, V(0.0)),
                  decl([ T17 ],
                     loop(i15, [ 0 .. 1 ],
                        chain(
                           decl([ w2 ],
                              decl([ s11 ],
                                 chain(
                                    chain(
                                       chain(
                                          assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                                       ),
                                       assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                                       assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                                       assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                                    )
                                 )
                              )
                           ),
                           assign(s9, cond(geq(s9, s12), s9, s12))
                        )
                     )
                  )
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ s12 ],
   chain(
      decl([ T12 ],
         chain(
            chain(
               chain(
                  assign(s13, V(0.0)),
                  decl([ T13, T14 ],
                     loop(i17, [ 0 .. 2 ],
                        chain(
                           assign(nth(T14, V(0)), nth(X, V(0))),
                           assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                           assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                           assign(s13, add(s13, nth(T12, V(0))))
                        )
                     )
                  ),
                  assign(s13, s13),
                  assign(s9, V(0.0)),
                  decl([ T17 ],
                     loop(i15, [ 0 .. 1 ],
                        chain(
                           decl([ w2 ],
                              decl([ s11 ],
                                 chain(
                                    chain(
                                       chain(
                                          assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                                       ),
                                       assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                                       assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                                       assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                                    )
                                 )
                              )
                           ),
                           assign(s9, cond(geq(s9, s12), s9, s12))
                        )
                     )
                  )
               )
            )
         )
      ),
      creturn(geq(s9, s13))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   decl([ T12 ],
      chain(
         chain(
            chain(
               assign(s13, V(0.0)),
               decl([ T13, T14 ],
                  loop(i17, [ 0 .. 2 ],
                     chain(
                        assign(nth(T14, V(0)), nth(X, V(0))),
                        assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                        assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                        assign(s13, add(s13, nth(T12, V(0))))
                     )
                  )
               ),
               assign(s13, s13),
               assign(s9, V(0.0)),
               decl([ T17 ],
                  loop(i15, [ 0 .. 1 ],
                     chain(
                        decl([ w2 ],
                           decl([ s11 ],
                              chain(
                                 chain(
                                    chain(
                                       assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                                    ),
                                    assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                                    assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                                    assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                                 )
                              )
                           )
                        ),
                        assign(s9, cond(geq(s9, s12), s9, s12))
                     )
                  )
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ T12 ],
   chain(
      chain(
         chain(
            chain(
               assign(s13, V(0.0)),
               decl([ T13, T14 ],
                  loop(i17, [ 0 .. 2 ],
                     chain(
                        assign(nth(T14, V(0)), nth(X, V(0))),
                        assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                        assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                        assign(s13, add(s13, nth(T12, V(0))))
                     )
                  )
               ),
               assign(s13, s13),
               assign(s9, V(0.0)),
               decl([ T17 ],
                  loop(i15, [ 0 .. 1 ],
                     chain(
                        decl([ w2 ],
                           decl([ s11 ],
                              chain(
                                 chain(
                                    chain(
                                       assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                                    ),
                                    assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                                    assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                                    assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                                 )
                              )
                           )
                        ),
                        assign(s9, cond(geq(s9, s12), s9, s12))
                     )
                  )
               )
            )
         )
      ),
      creturn(geq(s9, s13))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      chain(
         chain(
            assign(s13, V(0.0)),
            decl([ T13, T14 ],
               loop(i17, [ 0 .. 2 ],
                  chain(
                     assign(nth(T14, V(0)), nth(X, V(0))),
                     assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                     assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                     assign(s13, add(s13, nth(T12, V(0))))
                  )
               )
            ),
            assign(s13, s13),
            assign(s9, V(0.0)),
            decl([ T17 ],
               loop(i15, [ 0 .. 1 ],
                  chain(
                     decl([ w2 ],
                        decl([ s11 ],
                           chain(
                              chain(
                                 chain(
                                    assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                                 ),
                                 assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                                 assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                                 assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                              )
                           )
                        )
                     ),
                     assign(s9, cond(geq(s9, s12), s9, s12))
                  )
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      chain(
         assign(s13, V(0.0)),
         decl([ T13, T14 ],
            loop(i17, [ 0 .. 2 ],
               chain(
                  assign(nth(T14, V(0)), nth(X, V(0))),
                  assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                  assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                  assign(s13, add(s13, nth(T12, V(0))))
               )
            )
         ),
         assign(s13, s13),
         assign(s9, V(0.0)),
         decl([ T17 ],
            loop(i15, [ 0 .. 1 ],
               chain(
                  decl([ w2 ],
                     decl([ s11 ],
                        chain(
                           chain(
                              chain(
                                 assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                              ),
                              assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                              assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                              assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                           )
                        )
                     )
                  ),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      chain(
         assign(s13, V(0.0)),
         decl([ T13, T14 ],
            loop(i17, [ 0 .. 2 ],
               chain(
                  assign(nth(T14, V(0)), nth(X, V(0))),
                  assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                  assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                  assign(s13, add(s13, nth(T12, V(0))))
               )
            )
         ),
         assign(s13, s13),
         assign(s9, V(0.0)),
         decl([ T17 ],
            loop(i15, [ 0 .. 1 ],
               chain(
                  decl([ w2 ],
                     decl([ s11 ],
                        chain(
                           chain(
                              chain(
                                 assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                              ),
                              assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                              assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                              assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                           )
                        )
                     )
                  ),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      decl([ T13, T14 ],
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(nth(T14, V(0)), nth(X, V(0))),
               assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
               assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
               assign(s13, add(s13, nth(T12, V(0))))
            )
         )
      ),
      assign(s13, s13),
      assign(s9, V(0.0)),
      decl([ T17 ],
         loop(i15, [ 0 .. 1 ],
            chain(
               decl([ w2 ],
                  decl([ s11 ],
                     chain(
                        chain(
                           chain(
                              assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                           ),
                           assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                           assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                           assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                        )
                     )
                  )
               ),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      decl([ T13, T14 ],
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(nth(T14, V(0)), nth(X, V(0))),
               assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
               assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
               assign(s13, add(s13, nth(T12, V(0))))
            )
         )
      ),
      assign(s13, s13),
      assign(s9, V(0.0)),
      decl([ T17 ],
         loop(i15, [ 0 .. 1 ],
            chain(
               decl([ w2 ],
                  decl([ s11 ],
                     chain(
                        chain(
                           chain(
                              assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                           ),
                           assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                           assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                           assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                        )
                     )
                  )
               ),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   decl([ T13, T14 ],
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(nth(T14, V(0)), nth(X, V(0))),
            assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
            assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
            assign(s13, add(s13, nth(T12, V(0))))
         )
      )
   ),
   assign(s13, s13),
   assign(s9, V(0.0)),
   decl([ T17 ],
      loop(i15, [ 0 .. 1 ],
         chain(
            decl([ w2 ],
               decl([ s11 ],
                  chain(
                     chain(
                        chain(
                           assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                        ),
                        assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                        assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                        assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                     )
                  )
               )
            ),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   decl([ T13, T14 ],
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(nth(T14, V(0)), nth(X, V(0))),
            assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
            assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
            assign(s13, add(s13, nth(T12, V(0))))
         )
      )
   ),
   assign(s13, s13),
   assign(s9, V(0.0)),
   decl([ T17 ],
      loop(i15, [ 0 .. 1 ],
         chain(
            decl([ w2 ],
               decl([ s11 ],
                  chain(
                     chain(
                        chain(
                           assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                        ),
                        assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                        assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                        assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                     )
                  )
               )
            ),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   decl([ T13, T14 ],
      chain(
         assign(s13, V(0.0)),
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(nth(T14, V(0)), nth(X, V(0))),
               assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
               assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
               assign(s13, add(s13, nth(T12, V(0))))
            )
         )
      )
   ),
   assign(s13, s13),
   assign(s9, V(0.0)),
   decl([ T17 ],
      loop(i15, [ 0 .. 1 ],
         chain(
            decl([ w2 ],
               decl([ s11 ],
                  chain(
                     chain(
                        chain(
                           assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                        ),
                        assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                        assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                        assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                     )
                  )
               )
            ),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   decl([ T13, T14 ],
      chain(
         assign(s13, V(0.0)),
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(nth(T14, V(0)), nth(X, V(0))),
               assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
               assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
               assign(s13, add(s13, nth(T12, V(0))))
            )
         )
      )
   ),
   assign(s13, s13),
   assign(s9, V(0.0)),
   decl([ T17 ],
      loop(i15, [ 0 .. 1 ],
         chain(
            decl([ w2 ],
               decl([ s11 ],
                  chain(
                     chain(
                        chain(
                           assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                        ),
                        assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                        assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                        assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                     )
                  )
               )
            ),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   decl([ T13, T14 ],
      chain(
         assign(s13, V(0.0)),
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(nth(T14, V(0)), nth(X, V(0))),
               assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
               assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
               assign(s13, add(s13, nth(T12, V(0))))
            )
         )
      )
   ),
   assign(s13, s13),
   decl([ T17 ],
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            chain(
               decl([ w2 ],
                  decl([ s11 ],
                     chain(
                        chain(
                           chain(
                              assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                           ),
                           assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                           assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                           assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                        )
                     )
                  )
               ),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   decl([ T13, T14 ],
      chain(
         assign(s13, V(0.0)),
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(nth(T14, V(0)), nth(X, V(0))),
               assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
               assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
               assign(s13, add(s13, nth(T12, V(0))))
            )
         )
      )
   ),
   assign(s13, s13),
   decl([ T17 ],
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            chain(
               decl([ w2 ],
                  decl([ s11 ],
                     chain(
                        chain(
                           chain(
                              assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                           ),
                           assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                           assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                           assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                        )
                     )
                  )
               ),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   decl([ T13, T14 ],
      chain(
         assign(s13, V(0.0)),
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(nth(T14, V(0)), nth(X, V(0))),
               assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
               assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
               assign(s13, add(s13, nth(T12, V(0))))
            )
         )
      )
   ),
   decl([ T17 ],
      chain(
         assign(s13, s13),
         chain(
            assign(s9, V(0.0)),
            loop(i15, [ 0 .. 1 ],
               chain(
                  decl([ w2 ],
                     decl([ s11 ],
                        chain(
                           chain(
                              chain(
                                 assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                              ),
                              assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                              assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                              assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                           )
                        )
                     )
                  ),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   decl([ T13, T14 ],
      chain(
         assign(s13, V(0.0)),
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(nth(T14, V(0)), nth(X, V(0))),
               assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
               assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
               assign(s13, add(s13, nth(T12, V(0))))
            )
         )
      )
   ),
   decl([ T17 ],
      chain(
         assign(s13, s13),
         chain(
            assign(s9, V(0.0)),
            loop(i15, [ 0 .. 1 ],
               chain(
                  decl([ w2 ],
                     decl([ s11 ],
                        chain(
                           chain(
                              chain(
                                 assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                              ),
                              assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                              assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                              assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                           )
                        )
                     )
                  ),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   decl([ T17 ],
      chain(
         decl([ T13, T14 ],
            chain(
               assign(s13, V(0.0)),
               loop(i17, [ 0 .. 2 ],
                  chain(
                     assign(nth(T14, V(0)), nth(X, V(0))),
                     assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                     assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                     assign(s13, add(s13, nth(T12, V(0))))
                  )
               )
            )
         ),
         chain(
            assign(s13, s13),
            chain(
               assign(s9, V(0.0)),
               loop(i15, [ 0 .. 1 ],
                  chain(
                     decl([ w2 ],
                        decl([ s11 ],
                           chain(
                              chain(
                                 chain(
                                    assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                                 ),
                                 assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                                 assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                                 assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                              )
                           )
                        )
                     ),
                     assign(s9, cond(geq(s9, s12), s9, s12))
                  )
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: scalarize_const
------------------------------------------------------------------
old expression
------------------------------------------------------------------
decl([ T17 ],
   chain(
      decl([ T13, T14 ],
         chain(
            assign(s13, V(0.0)),
            loop(i17, [ 0 .. 2 ],
               chain(
                  assign(nth(T14, V(0)), nth(X, V(0))),
                  assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                  assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                  assign(s13, add(s13, nth(T12, V(0))))
               )
            )
         )
      ),
      chain(
         assign(s13, s13),
         chain(
            assign(s9, V(0.0)),
            loop(i15, [ 0 .. 1 ],
               chain(
                  decl([ w2 ],
                     decl([ s11 ],
                        chain(
                           chain(
                              chain(
                                 assign(nth(T17, V(0)), nth(X, add(i15, V(1))))
                              ),
                              assign(nth(T17, V(1)), nth(X, add(V(3), i15))),
                              assign(w2, sub(nth(T17, V(0)), nth(T17, V(1)))),
                              assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                           )
                        )
                     )
                  ),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T17, V(0))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
q7
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T17, V(0))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
q7
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T17, V(1))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
q8
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T17, V(1))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
q8
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ q7, q8 ],
   chain(
      decl([ T13, T14 ],
         chain(
            assign(s13, V(0.0)),
            loop(i17, [ 0 .. 2 ],
               chain(
                  assign(nth(T14, V(0)), nth(X, V(0))),
                  assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                  assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                  assign(s13, add(s13, nth(T12, V(0))))
               )
            )
         )
      ),
      chain(
         assign(s13, s13),
         chain(
            assign(s9, V(0.0)),
            loop(i15, [ 0 .. 1 ],
               chain(
                  decl([ w2 ],
                     decl([ s11 ],
                        chain(
                           chain(
                              chain(
                                 assign(q7, nth(X, add(i15, V(1))))
                              ),
                              assign(q8, nth(X, add(V(3), i15))),
                              assign(w2, sub(q7, q8)),
                              assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                           )
                        )
                     )
                  ),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   decl([ T13, T14 ],
      chain(
         assign(s13, V(0.0)),
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(nth(T14, V(0)), nth(X, V(0))),
               assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
               assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
               assign(s13, add(s13, nth(T12, V(0))))
            )
         )
      )
   ),
   chain(
      assign(s13, s13),
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            chain(
               decl([ w2 ],
                  decl([ s11 ],
                     chain(
                        chain(
                           chain(
                              assign(q7, nth(X, add(i15, V(1))))
                           ),
                           assign(q8, nth(X, add(V(3), i15))),
                           assign(w2, sub(q7, q8)),
                           assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                        )
                     )
                  )
               ),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ T13, T14 ],
   chain(
      chain(
         assign(s13, V(0.0)),
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(nth(T14, V(0)), nth(X, V(0))),
               assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
               assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
               assign(s13, add(s13, nth(T12, V(0))))
            )
         )
      ),
      chain(
         assign(s13, s13),
         chain(
            assign(s9, V(0.0)),
            loop(i15, [ 0 .. 1 ],
               chain(
                  decl([ w2 ],
                     decl([ s11 ],
                        chain(
                           chain(
                              chain(
                                 assign(q7, nth(X, add(i15, V(1))))
                              ),
                              assign(q8, nth(X, add(V(3), i15))),
                              assign(w2, sub(q7, q8)),
                              assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                           )
                        )
                     )
                  ),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(nth(T14, V(0)), nth(X, V(0))),
            assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
            assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
            assign(s13, add(s13, nth(T12, V(0))))
         )
      )
   ),
   chain(
      assign(s13, s13),
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            chain(
               decl([ w2 ],
                  decl([ s11 ],
                     chain(
                        chain(
                           chain(
                              assign(q7, nth(X, add(i15, V(1))))
                           ),
                           assign(q8, nth(X, add(V(3), i15))),
                           assign(w2, sub(q7, q8)),
                           assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                        )
                     )
                  )
               ),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   loop(i17, [ 0 .. 2 ],
      chain(
         assign(nth(T14, V(0)), nth(X, V(0))),
         assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
         assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
         assign(s13, add(s13, nth(T12, V(0))))
      )
   ),
   chain(
      assign(s13, s13),
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            chain(
               decl([ w2 ],
                  decl([ s11 ],
                     chain(
                        chain(
                           chain(
                              assign(q7, nth(X, add(i15, V(1))))
                           ),
                           assign(q8, nth(X, add(V(3), i15))),
                           assign(w2, sub(q7, q8)),
                           assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                        )
                     )
                  )
               ),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   loop(i17, [ 0 .. 2 ],
      chain(
         assign(nth(T14, V(0)), nth(X, V(0))),
         assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
         assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
         assign(s13, add(s13, nth(T12, V(0))))
      )
   ),
   chain(
      assign(s13, s13),
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            chain(
               decl([ w2 ],
                  decl([ s11 ],
                     chain(
                        chain(
                           chain(
                              assign(q7, nth(X, add(i15, V(1))))
                           ),
                           assign(q8, nth(X, add(V(3), i15))),
                           assign(w2, sub(q7, q8)),
                           assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                        )
                     )
                  )
               ),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   chain(
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(nth(T14, V(0)), nth(X, V(0))),
            assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
            assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
            assign(s13, add(s13, nth(T12, V(0))))
         )
      ),
      assign(s13, s13),
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            chain(
               decl([ w2 ],
                  decl([ s11 ],
                     chain(
                        chain(
                           chain(
                              assign(q7, nth(X, add(i15, V(1))))
                           ),
                           assign(q8, nth(X, add(V(3), i15))),
                           assign(w2, sub(q7, q8)),
                           assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                        )
                     )
                  )
               ),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   chain(
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(nth(T14, V(0)), nth(X, V(0))),
            assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
            assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
            assign(s13, add(s13, nth(T12, V(0))))
         )
      ),
      assign(s13, s13),
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            chain(
               decl([ w2 ],
                  decl([ s11 ],
                     chain(
                        chain(
                           chain(
                              assign(q7, nth(X, add(i15, V(1))))
                           ),
                           assign(q8, nth(X, add(V(3), i15))),
                           assign(w2, sub(q7, q8)),
                           assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                        )
                     )
                  )
               ),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(nth(T14, V(0)), nth(X, V(0))),
            assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
            assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
            assign(s13, add(s13, nth(T12, V(0))))
         )
      ),
      assign(s13, s13),
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            chain(
               decl([ w2 ],
                  decl([ s11 ],
                     chain(
                        chain(
                           chain(
                              assign(q7, nth(X, add(i15, V(1))))
                           ),
                           assign(q8, nth(X, add(V(3), i15))),
                           assign(w2, sub(q7, q8)),
                           assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                        )
                     )
                  )
               ),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   loop(i17, [ 0 .. 2 ],
      chain(
         assign(nth(T14, V(0)), nth(X, V(0))),
         assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
         assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
         assign(s13, add(s13, nth(T12, V(0))))
      )
   ),
   assign(s13, s13),
   chain(
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         chain(
            decl([ w2 ],
               decl([ s11 ],
                  chain(
                     chain(
                        chain(
                           assign(q7, nth(X, add(i15, V(1))))
                        ),
                        assign(q8, nth(X, add(V(3), i15))),
                        assign(w2, sub(q7, q8)),
                        assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                     )
                  )
               )
            ),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   loop(i17, [ 0 .. 2 ],
      chain(
         assign(nth(T14, V(0)), nth(X, V(0))),
         assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
         assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
         assign(s13, add(s13, nth(T12, V(0))))
      )
   ),
   chain(
      assign(s13, s13),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         chain(
            decl([ w2 ],
               decl([ s11 ],
                  chain(
                     chain(
                        chain(
                           assign(q7, nth(X, add(i15, V(1))))
                        ),
                        assign(q8, nth(X, add(V(3), i15))),
                        assign(w2, sub(q7, q8)),
                        assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                     )
                  )
               )
            ),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   loop(i17, [ 0 .. 2 ],
      chain(
         assign(nth(T14, V(0)), nth(X, V(0))),
         assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
         assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
         assign(s13, add(s13, nth(T12, V(0))))
      )
   ),
   chain(
      assign(s13, s13),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         chain(
            decl([ w2 ],
               decl([ s11 ],
                  chain(
                     chain(
                        chain(
                           assign(q7, nth(X, add(i15, V(1))))
                        ),
                        assign(q8, nth(X, add(V(3), i15))),
                        assign(w2, sub(q7, q8)),
                        assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                     )
                  )
               )
            ),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   chain(
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(nth(T14, V(0)), nth(X, V(0))),
            assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
            assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
            assign(s13, add(s13, nth(T12, V(0))))
         )
      ),
      assign(s13, s13),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         chain(
            decl([ w2 ],
               decl([ s11 ],
                  chain(
                     chain(
                        chain(
                           assign(q7, nth(X, add(i15, V(1))))
                        ),
                        assign(q8, nth(X, add(V(3), i15))),
                        assign(w2, sub(q7, q8)),
                        assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                     )
                  )
               )
            ),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   chain(
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(nth(T14, V(0)), nth(X, V(0))),
            assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
            assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
            assign(s13, add(s13, nth(T12, V(0))))
         )
      ),
      assign(s13, s13),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         chain(
            decl([ w2 ],
               decl([ s11 ],
                  chain(
                     chain(
                        chain(
                           assign(q7, nth(X, add(i15, V(1))))
                        ),
                        assign(q8, nth(X, add(V(3), i15))),
                        assign(w2, sub(q7, q8)),
                        assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                     )
                  )
               )
            ),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(nth(T14, V(0)), nth(X, V(0))),
            assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
            assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
            assign(s13, add(s13, nth(T12, V(0))))
         )
      ),
      assign(s13, s13),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         chain(
            decl([ w2 ],
               decl([ s11 ],
                  chain(
                     chain(
                        chain(
                           assign(q7, nth(X, add(i15, V(1))))
                        ),
                        assign(q8, nth(X, add(V(3), i15))),
                        assign(w2, sub(q7, q8)),
                        assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                     )
                  )
               )
            ),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: drop_selfassign
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   loop(i17, [ 0 .. 2 ],
      chain(
         assign(nth(T14, V(0)), nth(X, V(0))),
         assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
         assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
         assign(s13, add(s13, nth(T12, V(0))))
      )
   ),
   assign(s13, s13),
   assign(s9, V(0.0)),
   loop(i15, [ 0 .. 1 ],
      chain(
         decl([ w2 ],
            decl([ s11 ],
               chain(
                  chain(
                     chain(
                        assign(q7, nth(X, add(i15, V(1))))
                     ),
                     assign(q8, nth(X, add(V(3), i15))),
                     assign(w2, sub(q7, q8)),
                     assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                  )
               )
            )
         ),
         assign(s9, cond(geq(s9, s12), s9, s12))
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   loop(i17, [ 0 .. 2 ],
      chain(
         assign(nth(T14, V(0)), nth(X, V(0))),
         assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
         assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
         assign(s13, add(s13, nth(T12, V(0))))
      )
   ),
   assign(s9, V(0.0)),
   loop(i15, [ 0 .. 1 ],
      chain(
         decl([ w2 ],
            decl([ s11 ],
               chain(
                  chain(
                     chain(
                        assign(q7, nth(X, add(i15, V(1))))
                     ),
                     assign(q8, nth(X, add(V(3), i15))),
                     assign(w2, sub(q7, q8)),
                     assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
                  )
               )
            )
         ),
         assign(s9, cond(geq(s9, s12), s9, s12))
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   decl([ w2 ],
      decl([ s11 ],
         chain(
            chain(
               chain(
                  assign(q7, nth(X, add(i15, V(1))))
               ),
               assign(q8, nth(X, add(V(3), i15))),
               assign(w2, sub(q7, q8)),
               assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
            )
         )
      )
   ),
   assign(s9, cond(geq(s9, s12), s9, s12))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ w2 ],
   chain(
      decl([ s11 ],
         chain(
            chain(
               chain(
                  assign(q7, nth(X, add(i15, V(1))))
               ),
               assign(q8, nth(X, add(V(3), i15))),
               assign(w2, sub(q7, q8)),
               assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
            )
         )
      ),
      assign(s9, cond(geq(s9, s12), s9, s12))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   decl([ s11 ],
      chain(
         chain(
            chain(
               assign(q7, nth(X, add(i15, V(1))))
            ),
            assign(q8, nth(X, add(V(3), i15))),
            assign(w2, sub(q7, q8)),
            assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
         )
      )
   ),
   assign(s9, cond(geq(s9, s12), s9, s12))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ s11 ],
   chain(
      chain(
         chain(
            chain(
               assign(q7, nth(X, add(i15, V(1))))
            ),
            assign(q8, nth(X, add(V(3), i15))),
            assign(w2, sub(q7, q8)),
            assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
         )
      ),
      assign(s9, cond(geq(s9, s12), s9, s12))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      chain(
         chain(
            assign(q7, nth(X, add(i15, V(1))))
         ),
         assign(q8, nth(X, add(V(3), i15))),
         assign(w2, sub(q7, q8)),
         assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
      )
   ),
   assign(s9, cond(geq(s9, s12), s9, s12))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      chain(
         assign(q7, nth(X, add(i15, V(1))))
      ),
      assign(q8, nth(X, add(V(3), i15))),
      assign(w2, sub(q7, q8)),
      assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
   ),
   assign(s9, cond(geq(s9, s12), s9, s12))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      chain(
         assign(q7, nth(X, add(i15, V(1))))
      ),
      assign(q8, nth(X, add(V(3), i15))),
      assign(w2, sub(q7, q8)),
      assign(s12, cond(geq(w2, V(0)), w2, neg(w2)))
   ),
   assign(s9, cond(geq(s9, s12), s9, s12))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(q7, nth(X, add(i15, V(1))))
   ),
   assign(q8, nth(X, add(V(3), i15))),
   assign(w2, sub(q7, q8)),
   assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
   assign(s9, cond(geq(s9, s12), s9, s12))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      assign(q7, nth(X, add(i15, V(1))))
   ),
   assign(q8, nth(X, add(V(3), i15))),
   assign(w2, sub(q7, q8)),
   assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
   assign(s9, cond(geq(s9, s12), s9, s12))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(q7, nth(X, add(i15, V(1)))),
   assign(q8, nth(X, add(V(3), i15))),
   assign(w2, sub(q7, q8)),
   assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
   assign(s9, cond(geq(s9, s12), s9, s12))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: decl_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
decl([ s13, s9 ],
   decl([ s12 ],
      decl([ T12 ],
         chain(
            decl([ q7, q8 ],
               decl([ T13, T14 ],
                  chain(
                     chain(
                        chain(
                           assign(s13, V(0.0)),
                           loop(i17, [ 0 .. 2 ],
                              chain(
                                 assign(nth(T14, V(0)), nth(X, V(0))),
                                 assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                                 assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                                 assign(s13, add(s13, nth(T12, V(0))))
                              )
                           ),
                           assign(s9, V(0.0)),
                           loop(i15, [ 0 .. 1 ],
                              decl([ w2 ],
                                 decl([ s11 ],
                                    chain(
                                       assign(q7, nth(X, add(i15, V(1)))),
                                       assign(q8, nth(X, add(V(3), i15))),
                                       assign(w2, sub(q7, q8)),
                                       assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                                       assign(s9, cond(geq(s9, s12), s9, s12))
                                    )
                                 )
                              )
                           )
                        )
                     )
                  )
               )
            ),
            creturn(geq(s9, s13))
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ s12, s13, s9 ],
   decl([ T12 ],
      chain(
         decl([ q7, q8 ],
            decl([ T13, T14 ],
               chain(
                  chain(
                     chain(
                        assign(s13, V(0.0)),
                        loop(i17, [ 0 .. 2 ],
                           chain(
                              assign(nth(T14, V(0)), nth(X, V(0))),
                              assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                              assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                              assign(s13, add(s13, nth(T12, V(0))))
                           )
                        ),
                        assign(s9, V(0.0)),
                        loop(i15, [ 0 .. 1 ],
                           decl([ w2 ],
                              decl([ s11 ],
                                 chain(
                                    assign(q7, nth(X, add(i15, V(1)))),
                                    assign(q8, nth(X, add(V(3), i15))),
                                    assign(w2, sub(q7, q8)),
                                    assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                                    assign(s9, cond(geq(s9, s12), s9, s12))
                                 )
                              )
                           )
                        )
                     )
                  )
               )
            )
         ),
         creturn(geq(s9, s13))
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: decl_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
decl([ s12, s13, s9 ],
   decl([ T12 ],
      chain(
         decl([ q7, q8 ],
            decl([ T13, T14 ],
               chain(
                  chain(
                     chain(
                        assign(s13, V(0.0)),
                        loop(i17, [ 0 .. 2 ],
                           chain(
                              assign(nth(T14, V(0)), nth(X, V(0))),
                              assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                              assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                              assign(s13, add(s13, nth(T12, V(0))))
                           )
                        ),
                        assign(s9, V(0.0)),
                        loop(i15, [ 0 .. 1 ],
                           decl([ w2 ],
                              decl([ s11 ],
                                 chain(
                                    assign(q7, nth(X, add(i15, V(1)))),
                                    assign(q8, nth(X, add(V(3), i15))),
                                    assign(w2, sub(q7, q8)),
                                    assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                                    assign(s9, cond(geq(s9, s12), s9, s12))
                                 )
                              )
                           )
                        )
                     )
                  )
               )
            )
         ),
         creturn(geq(s9, s13))
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ T12, s12, s13, s9 ],
   chain(
      decl([ q7, q8 ],
         decl([ T13, T14 ],
            chain(
               chain(
                  chain(
                     assign(s13, V(0.0)),
                     loop(i17, [ 0 .. 2 ],
                        chain(
                           assign(nth(T14, V(0)), nth(X, V(0))),
                           assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                           assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                           assign(s13, add(s13, nth(T12, V(0))))
                        )
                     ),
                     assign(s9, V(0.0)),
                     loop(i15, [ 0 .. 1 ],
                        decl([ w2 ],
                           decl([ s11 ],
                              chain(
                                 assign(q7, nth(X, add(i15, V(1)))),
                                 assign(q8, nth(X, add(V(3), i15))),
                                 assign(w2, sub(q7, q8)),
                                 assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                                 assign(s9, cond(geq(s9, s12), s9, s12))
                              )
                           )
                        )
                     )
                  )
               )
            )
         )
      ),
      creturn(geq(s9, s13))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: scalarize1
------------------------------------------------------------------
old expression
------------------------------------------------------------------
decl([ T12, s12, s13, s9 ],
   chain(
      decl([ q7, q8 ],
         decl([ T13, T14 ],
            chain(
               chain(
                  chain(
                     assign(s13, V(0.0)),
                     loop(i17, [ 0 .. 2 ],
                        chain(
                           assign(nth(T14, V(0)), nth(X, V(0))),
                           assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                           assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17))),
                           assign(s13, add(s13, nth(T12, V(0))))
                        )
                     ),
                     assign(s9, V(0.0)),
                     loop(i15, [ 0 .. 1 ],
                        decl([ w2 ],
                           decl([ s11 ],
                              chain(
                                 assign(q7, nth(X, add(i15, V(1)))),
                                 assign(q8, nth(X, add(V(3), i15))),
                                 assign(w2, sub(q7, q8)),
                                 assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                                 assign(s9, cond(geq(s9, s12), s9, s12))
                              )
                           )
                        )
                     )
                  )
               )
            )
         )
      ),
      creturn(geq(s9, s13))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T12, V(0))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
s14
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T12, V(0))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
s14
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ s12, s13, s14, s9 ],
   chain(
      decl([ q7, q8 ],
         decl([ T13, T14 ],
            chain(
               chain(
                  chain(
                     assign(s13, V(0.0)),
                     loop(i17, [ 0 .. 2 ],
                        chain(
                           assign(nth(T14, V(0)), nth(X, V(0))),
                           assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                           assign(s14, mul(nth(T13, V(0)), nth(D, i17))),
                           assign(s13, add(s13, s14))
                        )
                     ),
                     assign(s9, V(0.0)),
                     loop(i15, [ 0 .. 1 ],
                        decl([ w2 ],
                           decl([ s11 ],
                              chain(
                                 assign(q7, nth(X, add(i15, V(1)))),
                                 assign(q8, nth(X, add(V(3), i15))),
                                 assign(w2, sub(q7, q8)),
                                 assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                                 assign(s9, cond(geq(s9, s12), s9, s12))
                              )
                           )
                        )
                     )
                  )
               )
            )
         )
      ),
      creturn(geq(s9, s13))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   decl([ q7, q8 ],
      decl([ T13, T14 ],
         chain(
            chain(
               chain(
                  assign(s13, V(0.0)),
                  loop(i17, [ 0 .. 2 ],
                     chain(
                        assign(nth(T14, V(0)), nth(X, V(0))),
                        assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                        assign(s14, mul(nth(T13, V(0)), nth(D, i17))),
                        assign(s13, add(s13, s14))
                     )
                  ),
                  assign(s9, V(0.0)),
                  loop(i15, [ 0 .. 1 ],
                     decl([ w2 ],
                        decl([ s11 ],
                           chain(
                              assign(q7, nth(X, add(i15, V(1)))),
                              assign(q8, nth(X, add(V(3), i15))),
                              assign(w2, sub(q7, q8)),
                              assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                              assign(s9, cond(geq(s9, s12), s9, s12))
                           )
                        )
                     )
                  )
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ q7, q8 ],
   chain(
      decl([ T13, T14 ],
         chain(
            chain(
               chain(
                  assign(s13, V(0.0)),
                  loop(i17, [ 0 .. 2 ],
                     chain(
                        assign(nth(T14, V(0)), nth(X, V(0))),
                        assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                        assign(s14, mul(nth(T13, V(0)), nth(D, i17))),
                        assign(s13, add(s13, s14))
                     )
                  ),
                  assign(s9, V(0.0)),
                  loop(i15, [ 0 .. 1 ],
                     decl([ w2 ],
                        decl([ s11 ],
                           chain(
                              assign(q7, nth(X, add(i15, V(1)))),
                              assign(q8, nth(X, add(V(3), i15))),
                              assign(w2, sub(q7, q8)),
                              assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                              assign(s9, cond(geq(s9, s12), s9, s12))
                           )
                        )
                     )
                  )
               )
            )
         )
      ),
      creturn(geq(s9, s13))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   decl([ T13, T14 ],
      chain(
         chain(
            chain(
               assign(s13, V(0.0)),
               loop(i17, [ 0 .. 2 ],
                  chain(
                     assign(nth(T14, V(0)), nth(X, V(0))),
                     assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                     assign(s14, mul(nth(T13, V(0)), nth(D, i17))),
                     assign(s13, add(s13, s14))
                  )
               ),
               assign(s9, V(0.0)),
               loop(i15, [ 0 .. 1 ],
                  decl([ w2 ],
                     decl([ s11 ],
                        chain(
                           assign(q7, nth(X, add(i15, V(1)))),
                           assign(q8, nth(X, add(V(3), i15))),
                           assign(w2, sub(q7, q8)),
                           assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                           assign(s9, cond(geq(s9, s12), s9, s12))
                        )
                     )
                  )
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ T13, T14 ],
   chain(
      chain(
         chain(
            chain(
               assign(s13, V(0.0)),
               loop(i17, [ 0 .. 2 ],
                  chain(
                     assign(nth(T14, V(0)), nth(X, V(0))),
                     assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                     assign(s14, mul(nth(T13, V(0)), nth(D, i17))),
                     assign(s13, add(s13, s14))
                  )
               ),
               assign(s9, V(0.0)),
               loop(i15, [ 0 .. 1 ],
                  decl([ w2 ],
                     decl([ s11 ],
                        chain(
                           assign(q7, nth(X, add(i15, V(1)))),
                           assign(q8, nth(X, add(V(3), i15))),
                           assign(w2, sub(q7, q8)),
                           assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                           assign(s9, cond(geq(s9, s12), s9, s12))
                        )
                     )
                  )
               )
            )
         )
      ),
      creturn(geq(s9, s13))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      chain(
         chain(
            assign(s13, V(0.0)),
            loop(i17, [ 0 .. 2 ],
               chain(
                  assign(nth(T14, V(0)), nth(X, V(0))),
                  assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                  assign(s14, mul(nth(T13, V(0)), nth(D, i17))),
                  assign(s13, add(s13, s14))
               )
            ),
            assign(s9, V(0.0)),
            loop(i15, [ 0 .. 1 ],
               decl([ w2 ],
                  decl([ s11 ],
                     chain(
                        assign(q7, nth(X, add(i15, V(1)))),
                        assign(q8, nth(X, add(V(3), i15))),
                        assign(w2, sub(q7, q8)),
                        assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                        assign(s9, cond(geq(s9, s12), s9, s12))
                     )
                  )
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      chain(
         assign(s13, V(0.0)),
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(nth(T14, V(0)), nth(X, V(0))),
               assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
               assign(s14, mul(nth(T13, V(0)), nth(D, i17))),
               assign(s13, add(s13, s14))
            )
         ),
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            decl([ w2 ],
               decl([ s11 ],
                  chain(
                     assign(q7, nth(X, add(i15, V(1)))),
                     assign(q8, nth(X, add(V(3), i15))),
                     assign(w2, sub(q7, q8)),
                     assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                     assign(s9, cond(geq(s9, s12), s9, s12))
                  )
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      chain(
         assign(s13, V(0.0)),
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(nth(T14, V(0)), nth(X, V(0))),
               assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
               assign(s14, mul(nth(T13, V(0)), nth(D, i17))),
               assign(s13, add(s13, s14))
            )
         ),
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            decl([ w2 ],
               decl([ s11 ],
                  chain(
                     assign(q7, nth(X, add(i15, V(1)))),
                     assign(q8, nth(X, add(V(3), i15))),
                     assign(w2, sub(q7, q8)),
                     assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                     assign(s9, cond(geq(s9, s12), s9, s12))
                  )
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(nth(T14, V(0)), nth(X, V(0))),
            assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
            assign(s14, mul(nth(T13, V(0)), nth(D, i17))),
            assign(s13, add(s13, s14))
         )
      ),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         decl([ w2 ],
            decl([ s11 ],
               chain(
                  assign(q7, nth(X, add(i15, V(1)))),
                  assign(q8, nth(X, add(V(3), i15))),
                  assign(w2, sub(q7, q8)),
                  assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(nth(T14, V(0)), nth(X, V(0))),
            assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
            assign(s14, mul(nth(T13, V(0)), nth(D, i17))),
            assign(s13, add(s13, s14))
         )
      ),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         decl([ w2 ],
            decl([ s11 ],
               chain(
                  assign(q7, nth(X, add(i15, V(1)))),
                  assign(q8, nth(X, add(V(3), i15))),
                  assign(w2, sub(q7, q8)),
                  assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   loop(i17, [ 0 .. 2 ],
      chain(
         assign(nth(T14, V(0)), nth(X, V(0))),
         assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
         assign(s14, mul(nth(T13, V(0)), nth(D, i17))),
         assign(s13, add(s13, s14))
      )
   ),
   assign(s9, V(0.0)),
   loop(i15, [ 0 .. 1 ],
      decl([ w2 ],
         decl([ s11 ],
            chain(
               assign(q7, nth(X, add(i15, V(1)))),
               assign(q8, nth(X, add(V(3), i15))),
               assign(w2, sub(q7, q8)),
               assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: loop_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
loop(i15, [ 0 .. 1 ],
   decl([ w2 ],
      decl([ s11 ],
         chain(
            assign(q7, nth(X, add(i15, V(1)))),
            assign(q8, nth(X, add(V(3), i15))),
            assign(w2, sub(q7, q8)),
            assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ w2 ],
   loop(i15, [ 0 .. 1 ],
      decl([ s11 ],
         chain(
            assign(q7, nth(X, add(i15, V(1)))),
            assign(q8, nth(X, add(V(3), i15))),
            assign(w2, sub(q7, q8)),
            assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: loop_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
loop(i15, [ 0 .. 1 ],
   decl([ s11 ],
      chain(
         assign(q7, nth(X, add(i15, V(1)))),
         assign(q8, nth(X, add(V(3), i15))),
         assign(w2, sub(q7, q8)),
         assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
         assign(s9, cond(geq(s9, s12), s9, s12))
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ s11 ],
   loop(i15, [ 0 .. 1 ],
      chain(
         assign(q7, nth(X, add(i15, V(1)))),
         assign(q8, nth(X, add(V(3), i15))),
         assign(w2, sub(q7, q8)),
         assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
         assign(s9, cond(geq(s9, s12), s9, s12))
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: decl_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
decl([ s12, s13, s14, s9 ],
   decl([ q7, q8 ],
      decl([ T13, T14 ],
         chain(
            assign(s13, V(0.0)),
            loop(i17, [ 0 .. 2 ],
               chain(
                  assign(nth(T14, V(0)), nth(X, V(0))),
                  assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                  assign(s14, mul(nth(T13, V(0)), nth(D, i17))),
                  assign(s13, add(s13, s14))
               )
            ),
            assign(s9, V(0.0)),
            decl([ w2 ],
               decl([ s11 ],
                  loop(i15, [ 0 .. 1 ],
                     chain(
                        assign(q7, nth(X, add(i15, V(1)))),
                        assign(q8, nth(X, add(V(3), i15))),
                        assign(w2, sub(q7, q8)),
                        assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                        assign(s9, cond(geq(s9, s12), s9, s12))
                     )
                  )
               )
            ),
            creturn(geq(s9, s13))
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ q7, q8, s12, s13, s14, s9 ],
   decl([ T13, T14 ],
      chain(
         assign(s13, V(0.0)),
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(nth(T14, V(0)), nth(X, V(0))),
               assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
               assign(s14, mul(nth(T13, V(0)), nth(D, i17))),
               assign(s13, add(s13, s14))
            )
         ),
         assign(s9, V(0.0)),
         decl([ w2 ],
            decl([ s11 ],
               loop(i15, [ 0 .. 1 ],
                  chain(
                     assign(q7, nth(X, add(i15, V(1)))),
                     assign(q8, nth(X, add(V(3), i15))),
                     assign(w2, sub(q7, q8)),
                     assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                     assign(s9, cond(geq(s9, s12), s9, s12))
                  )
               )
            )
         ),
         creturn(geq(s9, s13))
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: decl_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
decl([ q7, q8, s12, s13, s14, s9 ],
   decl([ T13, T14 ],
      chain(
         assign(s13, V(0.0)),
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(nth(T14, V(0)), nth(X, V(0))),
               assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
               assign(s14, mul(nth(T13, V(0)), nth(D, i17))),
               assign(s13, add(s13, s14))
            )
         ),
         assign(s9, V(0.0)),
         decl([ w2 ],
            decl([ s11 ],
               loop(i15, [ 0 .. 1 ],
                  chain(
                     assign(q7, nth(X, add(i15, V(1)))),
                     assign(q8, nth(X, add(V(3), i15))),
                     assign(w2, sub(q7, q8)),
                     assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                     assign(s9, cond(geq(s9, s12), s9, s12))
                  )
               )
            )
         ),
         creturn(geq(s9, s13))
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ T13, T14, q7, q8, s12, s13, s14, s9 ],
   chain(
      assign(s13, V(0.0)),
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(nth(T14, V(0)), nth(X, V(0))),
            assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
            assign(s14, mul(nth(T13, V(0)), nth(D, i17))),
            assign(s13, add(s13, s14))
         )
      ),
      assign(s9, V(0.0)),
      decl([ w2 ],
         decl([ s11 ],
            loop(i15, [ 0 .. 1 ],
               chain(
                  assign(q7, nth(X, add(i15, V(1)))),
                  assign(q8, nth(X, add(V(3), i15))),
                  assign(w2, sub(q7, q8)),
                  assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      ),
      creturn(geq(s9, s13))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: scalarize1
------------------------------------------------------------------
old expression
------------------------------------------------------------------
decl([ T13, T14, q7, q8, s12, s13, s14, s9 ],
   chain(
      assign(s13, V(0.0)),
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(nth(T14, V(0)), nth(X, V(0))),
            assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
            assign(s14, mul(nth(T13, V(0)), nth(D, i17))),
            assign(s13, add(s13, s14))
         )
      ),
      assign(s9, V(0.0)),
      decl([ w2 ],
         decl([ s11 ],
            loop(i15, [ 0 .. 1 ],
               chain(
                  assign(q7, nth(X, add(i15, V(1)))),
                  assign(q8, nth(X, add(V(3), i15))),
                  assign(w2, sub(q7, q8)),
                  assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      ),
      creturn(geq(s9, s13))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T13, V(0))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
s15
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T13, V(0))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
s15
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T13, V(0))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
s15
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ T14, q7, q8, s12, s13, s14, s15, s9 ],
   chain(
      assign(s13, V(0.0)),
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(nth(T14, V(0)), nth(X, V(0))),
            assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, nth(T14, V(0))))),
            assign(s14, mul(s15, nth(D, i17))),
            assign(s13, add(s13, s14))
         )
      ),
      assign(s9, V(0.0)),
      decl([ w2 ],
         decl([ s11 ],
            loop(i15, [ 0 .. 1 ],
               chain(
                  assign(q7, nth(X, add(i15, V(1)))),
                  assign(q8, nth(X, add(V(3), i15))),
                  assign(w2, sub(q7, q8)),
                  assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      ),
      creturn(geq(s9, s13))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: scalarize1
------------------------------------------------------------------
old expression
------------------------------------------------------------------
decl([ T14, q7, q8, s12, s13, s14, s15, s9 ],
   chain(
      assign(s13, V(0.0)),
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(nth(T14, V(0)), nth(X, V(0))),
            assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, nth(T14, V(0))))),
            assign(s14, mul(s15, nth(D, i17))),
            assign(s13, add(s13, s14))
         )
      ),
      assign(s9, V(0.0)),
      decl([ w2 ],
         decl([ s11 ],
            loop(i15, [ 0 .. 1 ],
               chain(
                  assign(q7, nth(X, add(i15, V(1)))),
                  assign(q8, nth(X, add(V(3), i15))),
                  assign(w2, sub(q7, q8)),
                  assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      ),
      creturn(geq(s9, s13))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T14, V(0))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
s16
------------------------------------------------------------------

------------------------------------------------------------------
RULE: unnamed(SubstTopDown)
------------------------------------------------------------------
old expression
------------------------------------------------------------------
nth(T14, V(0))
------------------------------------------------------------------
new expression
------------------------------------------------------------------
s16
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ q7, q8, s12, s13, s14, s15, s16, s9 ],
   chain(
      assign(s13, V(0.0)),
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(s16, nth(X, V(0))),
            assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, s16))),
            assign(s14, mul(s15, nth(D, i17))),
            assign(s13, add(s13, s14))
         )
      ),
      assign(s9, V(0.0)),
      decl([ w2 ],
         decl([ s11 ],
            loop(i15, [ 0 .. 1 ],
               chain(
                  assign(q7, nth(X, add(i15, V(1)))),
                  assign(q8, nth(X, add(V(3), i15))),
                  assign(w2, sub(q7, q8)),
                  assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      ),
      creturn(geq(s9, s13))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   loop(i17, [ 0 .. 2 ],
      chain(
         assign(s16, nth(X, V(0))),
         assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, s16))),
         assign(s14, mul(s15, nth(D, i17))),
         assign(s13, add(s13, s14))
      )
   ),
   assign(s9, V(0.0)),
   decl([ w2 ],
      decl([ s11 ],
         loop(i15, [ 0 .. 1 ],
            chain(
               assign(q7, nth(X, add(i15, V(1)))),
               assign(q8, nth(X, add(V(3), i15))),
               assign(w2, sub(q7, q8)),
               assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   loop(i17, [ 0 .. 2 ],
      chain(
         assign(s16, nth(X, V(0))),
         assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, s16))),
         assign(s14, mul(s15, nth(D, i17))),
         assign(s13, add(s13, s14))
      )
   ),
   decl([ w2 ],
      chain(
         assign(s9, V(0.0)),
         decl([ s11 ],
            loop(i15, [ 0 .. 1 ],
               chain(
                  assign(q7, nth(X, add(i15, V(1)))),
                  assign(q8, nth(X, add(V(3), i15))),
                  assign(w2, sub(q7, q8)),
                  assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   loop(i17, [ 0 .. 2 ],
      chain(
         assign(s16, nth(X, V(0))),
         assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, s16))),
         assign(s14, mul(s15, nth(D, i17))),
         assign(s13, add(s13, s14))
      )
   ),
   decl([ w2 ],
      chain(
         assign(s9, V(0.0)),
         decl([ s11 ],
            loop(i15, [ 0 .. 1 ],
               chain(
                  assign(q7, nth(X, add(i15, V(1)))),
                  assign(q8, nth(X, add(V(3), i15))),
                  assign(w2, sub(q7, q8)),
                  assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   decl([ w2 ],
      chain(
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(s16, nth(X, V(0))),
               assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, s16))),
               assign(s14, mul(s15, nth(D, i17))),
               assign(s13, add(s13, s14))
            )
         ),
         chain(
            assign(s9, V(0.0)),
            decl([ s11 ],
               loop(i15, [ 0 .. 1 ],
                  chain(
                     assign(q7, nth(X, add(i15, V(1)))),
                     assign(q8, nth(X, add(V(3), i15))),
                     assign(w2, sub(q7, q8)),
                     assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                     assign(s9, cond(geq(s9, s12), s9, s12))
                  )
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   decl([ w2 ],
      chain(
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(s16, nth(X, V(0))),
               assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, s16))),
               assign(s14, mul(s15, nth(D, i17))),
               assign(s13, add(s13, s14))
            )
         ),
         chain(
            assign(s9, V(0.0)),
            decl([ s11 ],
               loop(i15, [ 0 .. 1 ],
                  chain(
                     assign(q7, nth(X, add(i15, V(1)))),
                     assign(q8, nth(X, add(V(3), i15))),
                     assign(w2, sub(q7, q8)),
                     assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                     assign(s9, cond(geq(s9, s12), s9, s12))
                  )
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   decl([ w2 ],
      chain(
         assign(s13, V(0.0)),
         chain(
            loop(i17, [ 0 .. 2 ],
               chain(
                  assign(s16, nth(X, V(0))),
                  assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, s16))),
                  assign(s14, mul(s15, nth(D, i17))),
                  assign(s13, add(s13, s14))
               )
            ),
            chain(
               assign(s9, V(0.0)),
               decl([ s11 ],
                  loop(i15, [ 0 .. 1 ],
                     chain(
                        assign(q7, nth(X, add(i15, V(1)))),
                        assign(q8, nth(X, add(V(3), i15))),
                        assign(w2, sub(q7, q8)),
                        assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                        assign(s9, cond(geq(s9, s12), s9, s12))
                     )
                  )
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   chain(
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(s16, nth(X, V(0))),
            assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, s16))),
            assign(s14, mul(s15, nth(D, i17))),
            assign(s13, add(s13, s14))
         )
      ),
      chain(
         assign(s9, V(0.0)),
         decl([ s11 ],
            loop(i15, [ 0 .. 1 ],
               chain(
                  assign(q7, nth(X, add(i15, V(1)))),
                  assign(q8, nth(X, add(V(3), i15))),
                  assign(w2, sub(q7, q8)),
                  assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(s16, nth(X, V(0))),
            assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, s16))),
            assign(s14, mul(s15, nth(D, i17))),
            assign(s13, add(s13, s14))
         )
      ),
      chain(
         assign(s9, V(0.0)),
         decl([ s11 ],
            loop(i15, [ 0 .. 1 ],
               chain(
                  assign(q7, nth(X, add(i15, V(1)))),
                  assign(q8, nth(X, add(V(3), i15))),
                  assign(w2, sub(q7, q8)),
                  assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   loop(i17, [ 0 .. 2 ],
      chain(
         assign(s16, nth(X, V(0))),
         assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, s16))),
         assign(s14, mul(s15, nth(D, i17))),
         assign(s13, add(s13, s14))
      )
   ),
   chain(
      assign(s9, V(0.0)),
      decl([ s11 ],
         loop(i15, [ 0 .. 1 ],
            chain(
               assign(q7, nth(X, add(i15, V(1)))),
               assign(q8, nth(X, add(V(3), i15))),
               assign(w2, sub(q7, q8)),
               assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   chain(
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(s16, nth(X, V(0))),
            assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, s16))),
            assign(s14, mul(s15, nth(D, i17))),
            assign(s13, add(s13, s14))
         )
      ),
      assign(s9, V(0.0)),
      decl([ s11 ],
         loop(i15, [ 0 .. 1 ],
            chain(
               assign(q7, nth(X, add(i15, V(1)))),
               assign(q8, nth(X, add(V(3), i15))),
               assign(w2, sub(q7, q8)),
               assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   chain(
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(s16, nth(X, V(0))),
            assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, s16))),
            assign(s14, mul(s15, nth(D, i17))),
            assign(s13, add(s13, s14))
         )
      ),
      assign(s9, V(0.0)),
      decl([ s11 ],
         loop(i15, [ 0 .. 1 ],
            chain(
               assign(q7, nth(X, add(i15, V(1)))),
               assign(q8, nth(X, add(V(3), i15))),
               assign(w2, sub(q7, q8)),
               assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(s16, nth(X, V(0))),
            assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, s16))),
            assign(s14, mul(s15, nth(D, i17))),
            assign(s13, add(s13, s14))
         )
      ),
      assign(s9, V(0.0)),
      decl([ s11 ],
         loop(i15, [ 0 .. 1 ],
            chain(
               assign(q7, nth(X, add(i15, V(1)))),
               assign(q8, nth(X, add(V(3), i15))),
               assign(w2, sub(q7, q8)),
               assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   loop(i17, [ 0 .. 2 ],
      chain(
         assign(s16, nth(X, V(0))),
         assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, s16))),
         assign(s14, mul(s15, nth(D, i17))),
         assign(s13, add(s13, s14))
      )
   ),
   assign(s9, V(0.0)),
   decl([ s11 ],
      loop(i15, [ 0 .. 1 ],
         chain(
            assign(q7, nth(X, add(i15, V(1)))),
            assign(q8, nth(X, add(V(3), i15))),
            assign(w2, sub(q7, q8)),
            assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   loop(i17, [ 0 .. 2 ],
      chain(
         assign(s16, nth(X, V(0))),
         assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, s16))),
         assign(s14, mul(s15, nth(D, i17))),
         assign(s13, add(s13, s14))
      )
   ),
   decl([ s11 ],
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            chain(
               assign(q7, nth(X, add(i15, V(1)))),
               assign(q8, nth(X, add(V(3), i15))),
               assign(w2, sub(q7, q8)),
               assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   loop(i17, [ 0 .. 2 ],
      chain(
         assign(s16, nth(X, V(0))),
         assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, s16))),
         assign(s14, mul(s15, nth(D, i17))),
         assign(s13, add(s13, s14))
      )
   ),
   decl([ s11 ],
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            chain(
               assign(q7, nth(X, add(i15, V(1)))),
               assign(q8, nth(X, add(V(3), i15))),
               assign(w2, sub(q7, q8)),
               assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   decl([ s11 ],
      chain(
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(s16, nth(X, V(0))),
               assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, s16))),
               assign(s14, mul(s15, nth(D, i17))),
               assign(s13, add(s13, s14))
            )
         ),
         chain(
            assign(s9, V(0.0)),
            loop(i15, [ 0 .. 1 ],
               chain(
                  assign(q7, nth(X, add(i15, V(1)))),
                  assign(q8, nth(X, add(V(3), i15))),
                  assign(w2, sub(q7, q8)),
                  assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   decl([ s11 ],
      chain(
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(s16, nth(X, V(0))),
               assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, s16))),
               assign(s14, mul(s15, nth(D, i17))),
               assign(s13, add(s13, s14))
            )
         ),
         chain(
            assign(s9, V(0.0)),
            loop(i15, [ 0 .. 1 ],
               chain(
                  assign(q7, nth(X, add(i15, V(1)))),
                  assign(q8, nth(X, add(V(3), i15))),
                  assign(w2, sub(q7, q8)),
                  assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   decl([ s11 ],
      chain(
         assign(s13, V(0.0)),
         chain(
            loop(i17, [ 0 .. 2 ],
               chain(
                  assign(s16, nth(X, V(0))),
                  assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, s16))),
                  assign(s14, mul(s15, nth(D, i17))),
                  assign(s13, add(s13, s14))
               )
            ),
            chain(
               assign(s9, V(0.0)),
               loop(i15, [ 0 .. 1 ],
                  chain(
                     assign(q7, nth(X, add(i15, V(1)))),
                     assign(q8, nth(X, add(V(3), i15))),
                     assign(w2, sub(q7, q8)),
                     assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                     assign(s9, cond(geq(s9, s12), s9, s12))
                  )
               )
            )
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: drop_unused
------------------------------------------------------------------
old expression
------------------------------------------------------------------
decl([ s11 ],
   chain(
      assign(s13, V(0.0)),
      chain(
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(s16, nth(X, V(0))),
               assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, s16))),
               assign(s14, mul(s15, nth(D, i17))),
               assign(s13, add(s13, s14))
            )
         ),
         chain(
            assign(s9, V(0.0)),
            loop(i15, [ 0 .. 1 ],
               chain(
                  assign(q7, nth(X, add(i15, V(1)))),
                  assign(q8, nth(X, add(V(3), i15))),
                  assign(w2, sub(q7, q8)),
                  assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   chain(
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(s16, nth(X, V(0))),
            assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, s16))),
            assign(s14, mul(s15, nth(D, i17))),
            assign(s13, add(s13, s14))
         )
      ),
      chain(
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            chain(
               assign(q7, nth(X, add(i15, V(1)))),
               assign(q8, nth(X, add(V(3), i15))),
               assign(w2, sub(q7, q8)),
               assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   loop(i17, [ 0 .. 2 ],
      chain(
         assign(s16, nth(X, V(0))),
         assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, s16))),
         assign(s14, mul(s15, nth(D, i17))),
         assign(s13, add(s13, s14))
      )
   ),
   chain(
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         chain(
            assign(q7, nth(X, add(i15, V(1)))),
            assign(q8, nth(X, add(V(3), i15))),
            assign(w2, sub(q7, q8)),
            assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(s16, nth(X, V(0))),
            assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, s16))),
            assign(s14, mul(s15, nth(D, i17))),
            assign(s13, add(s13, s14))
         )
      ),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         chain(
            assign(q7, nth(X, add(i15, V(1)))),
            assign(q8, nth(X, add(V(3), i15))),
            assign(w2, sub(q7, q8)),
            assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: loop_pull_const_array
------------------------------------------------------------------
old expression
------------------------------------------------------------------
loop(i17, [ 0 .. 2 ],
   chain(
      assign(s16, nth(X, V(0))),
      assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, s16))),
      assign(s14, mul(s15, nth(D, i17))),
      assign(s13, add(s13, s14))
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(s16, nth(X, V(0))),
   loop(i17, [ 0 .. 2 ],
      chain(
         assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, s16))),
         assign(s14, mul(s15, nth(D, i17))),
         assign(s13, add(s13, s14))
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: loop_pull_cond
------------------------------------------------------------------
old expression
------------------------------------------------------------------
loop(i17, [ 0 .. 2 ],
   chain(
      assign(s15, cond(eq(i17, V(0)), V(1.0), mul(s15, s16))),
      assign(s14, mul(s15, nth(D, i17))),
      assign(s13, add(s13, s14))
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(s15, V(1.0)),
   loop(i17, [ 0 .. 2 ],
      chain(
         assign(s14, mul(s15, nth(D, i17))),
         assign(s13, add(s13, s14)),
         assign(s15, mul(s15, s16))
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   decl([ w2 ],
      chain(
         chain(
            chain(
               chain(
                  assign(s13, V(0.0)),
                  chain(
                     chain(
                        chain(
                           assign(s16, nth(X, V(0))),
                           chain(
                              assign(s15, V(1.0)),
                              loop(i17, [ 0 .. 2 ],
                                 chain(
                                    assign(s14, mul(s15, nth(D, i17))),
                                    assign(s13, add(s13, s14)),
                                    assign(s15, mul(s15, s16))
                                 )
                              )
                           )
                        ),
                        assign(s9, V(0.0)),
                        loop(i15, [ 0 .. 1 ],
                           chain(
                              assign(q7, nth(X, add(i15, V(1)))),
                              assign(q8, nth(X, add(V(3), i15))),
                              assign(w2, sub(q7, q8)),
                              assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                              assign(s9, cond(geq(s9, s12), s9, s12))
                           )
                        )
                     )
                  )
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ w2 ],
   chain(
      chain(
         chain(
            chain(
               chain(
                  assign(s13, V(0.0)),
                  chain(
                     chain(
                        chain(
                           assign(s16, nth(X, V(0))),
                           chain(
                              assign(s15, V(1.0)),
                              loop(i17, [ 0 .. 2 ],
                                 chain(
                                    assign(s14, mul(s15, nth(D, i17))),
                                    assign(s13, add(s13, s14)),
                                    assign(s15, mul(s15, s16))
                                 )
                              )
                           )
                        ),
                        assign(s9, V(0.0)),
                        loop(i15, [ 0 .. 1 ],
                           chain(
                              assign(q7, nth(X, add(i15, V(1)))),
                              assign(q8, nth(X, add(V(3), i15))),
                              assign(w2, sub(q7, q8)),
                              assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                              assign(s9, cond(geq(s9, s12), s9, s12))
                           )
                        )
                     )
                  )
               )
            )
         )
      ),
      creturn(geq(s9, s13))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      chain(
         chain(
            chain(
               assign(s13, V(0.0)),
               chain(
                  chain(
                     chain(
                        assign(s16, nth(X, V(0))),
                        chain(
                           assign(s15, V(1.0)),
                           loop(i17, [ 0 .. 2 ],
                              chain(
                                 assign(s14, mul(s15, nth(D, i17))),
                                 assign(s13, add(s13, s14)),
                                 assign(s15, mul(s15, s16))
                              )
                           )
                        )
                     ),
                     assign(s9, V(0.0)),
                     loop(i15, [ 0 .. 1 ],
                        chain(
                           assign(q7, nth(X, add(i15, V(1)))),
                           assign(q8, nth(X, add(V(3), i15))),
                           assign(w2, sub(q7, q8)),
                           assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                           assign(s9, cond(geq(s9, s12), s9, s12))
                        )
                     )
                  )
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      chain(
         chain(
            assign(s13, V(0.0)),
            chain(
               chain(
                  chain(
                     assign(s16, nth(X, V(0))),
                     chain(
                        assign(s15, V(1.0)),
                        loop(i17, [ 0 .. 2 ],
                           chain(
                              assign(s14, mul(s15, nth(D, i17))),
                              assign(s13, add(s13, s14)),
                              assign(s15, mul(s15, s16))
                           )
                        )
                     )
                  ),
                  assign(s9, V(0.0)),
                  loop(i15, [ 0 .. 1 ],
                     chain(
                        assign(q7, nth(X, add(i15, V(1)))),
                        assign(q8, nth(X, add(V(3), i15))),
                        assign(w2, sub(q7, q8)),
                        assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                        assign(s9, cond(geq(s9, s12), s9, s12))
                     )
                  )
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      chain(
         chain(
            assign(s13, V(0.0)),
            chain(
               chain(
                  chain(
                     assign(s16, nth(X, V(0))),
                     chain(
                        assign(s15, V(1.0)),
                        loop(i17, [ 0 .. 2 ],
                           chain(
                              assign(s14, mul(s15, nth(D, i17))),
                              assign(s13, add(s13, s14)),
                              assign(s15, mul(s15, s16))
                           )
                        )
                     )
                  ),
                  assign(s9, V(0.0)),
                  loop(i15, [ 0 .. 1 ],
                     chain(
                        assign(q7, nth(X, add(i15, V(1)))),
                        assign(q8, nth(X, add(V(3), i15))),
                        assign(w2, sub(q7, q8)),
                        assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                        assign(s9, cond(geq(s9, s12), s9, s12))
                     )
                  )
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      chain(
         assign(s13, V(0.0)),
         chain(
            chain(
               chain(
                  assign(s16, nth(X, V(0))),
                  chain(
                     assign(s15, V(1.0)),
                     loop(i17, [ 0 .. 2 ],
                        chain(
                           assign(s14, mul(s15, nth(D, i17))),
                           assign(s13, add(s13, s14)),
                           assign(s15, mul(s15, s16))
                        )
                     )
                  )
               ),
               assign(s9, V(0.0)),
               loop(i15, [ 0 .. 1 ],
                  chain(
                     assign(q7, nth(X, add(i15, V(1)))),
                     assign(q8, nth(X, add(V(3), i15))),
                     assign(w2, sub(q7, q8)),
                     assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                     assign(s9, cond(geq(s9, s12), s9, s12))
                  )
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      chain(
         assign(s13, V(0.0)),
         chain(
            chain(
               chain(
                  assign(s16, nth(X, V(0))),
                  chain(
                     assign(s15, V(1.0)),
                     loop(i17, [ 0 .. 2 ],
                        chain(
                           assign(s14, mul(s15, nth(D, i17))),
                           assign(s13, add(s13, s14)),
                           assign(s15, mul(s15, s16))
                        )
                     )
                  )
               ),
               assign(s9, V(0.0)),
               loop(i15, [ 0 .. 1 ],
                  chain(
                     assign(q7, nth(X, add(i15, V(1)))),
                     assign(q8, nth(X, add(V(3), i15))),
                     assign(w2, sub(q7, q8)),
                     assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                     assign(s9, cond(geq(s9, s12), s9, s12))
                  )
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      chain(
         chain(
            chain(
               assign(s16, nth(X, V(0))),
               chain(
                  assign(s15, V(1.0)),
                  loop(i17, [ 0 .. 2 ],
                     chain(
                        assign(s14, mul(s15, nth(D, i17))),
                        assign(s13, add(s13, s14)),
                        assign(s15, mul(s15, s16))
                     )
                  )
               )
            ),
            assign(s9, V(0.0)),
            loop(i15, [ 0 .. 1 ],
               chain(
                  assign(q7, nth(X, add(i15, V(1)))),
                  assign(q8, nth(X, add(V(3), i15))),
                  assign(w2, sub(q7, q8)),
                  assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      chain(
         chain(
            chain(
               assign(s16, nth(X, V(0))),
               chain(
                  assign(s15, V(1.0)),
                  loop(i17, [ 0 .. 2 ],
                     chain(
                        assign(s14, mul(s15, nth(D, i17))),
                        assign(s13, add(s13, s14)),
                        assign(s15, mul(s15, s16))
                     )
                  )
               )
            ),
            assign(s9, V(0.0)),
            loop(i15, [ 0 .. 1 ],
               chain(
                  assign(q7, nth(X, add(i15, V(1)))),
                  assign(q8, nth(X, add(V(3), i15))),
                  assign(w2, sub(q7, q8)),
                  assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   chain(
      chain(
         chain(
            assign(s16, nth(X, V(0))),
            chain(
               assign(s15, V(1.0)),
               loop(i17, [ 0 .. 2 ],
                  chain(
                     assign(s14, mul(s15, nth(D, i17))),
                     assign(s13, add(s13, s14)),
                     assign(s15, mul(s15, s16))
                  )
               )
            )
         ),
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            chain(
               assign(q7, nth(X, add(i15, V(1)))),
               assign(q8, nth(X, add(V(3), i15))),
               assign(w2, sub(q7, q8)),
               assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   chain(
      chain(
         chain(
            assign(s16, nth(X, V(0))),
            chain(
               assign(s15, V(1.0)),
               loop(i17, [ 0 .. 2 ],
                  chain(
                     assign(s14, mul(s15, nth(D, i17))),
                     assign(s13, add(s13, s14)),
                     assign(s15, mul(s15, s16))
                  )
               )
            )
         ),
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            chain(
               assign(q7, nth(X, add(i15, V(1)))),
               assign(q8, nth(X, add(V(3), i15))),
               assign(w2, sub(q7, q8)),
               assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      chain(
         chain(
            assign(s16, nth(X, V(0))),
            chain(
               assign(s15, V(1.0)),
               loop(i17, [ 0 .. 2 ],
                  chain(
                     assign(s14, mul(s15, nth(D, i17))),
                     assign(s13, add(s13, s14)),
                     assign(s15, mul(s15, s16))
                  )
               )
            )
         ),
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            chain(
               assign(q7, nth(X, add(i15, V(1)))),
               assign(q8, nth(X, add(V(3), i15))),
               assign(w2, sub(q7, q8)),
               assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain_xyz
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      chain(
         chain(
            assign(s16, nth(X, V(0))),
            chain(
               assign(s15, V(1.0)),
               loop(i17, [ 0 .. 2 ],
                  chain(
                     assign(s14, mul(s15, nth(D, i17))),
                     assign(s13, add(s13, s14)),
                     assign(s15, mul(s15, s16))
                  )
               )
            )
         ),
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            chain(
               assign(q7, nth(X, add(i15, V(1)))),
               assign(q8, nth(X, add(V(3), i15))),
               assign(w2, sub(q7, q8)),
               assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      chain(
         chain(
            assign(s16, nth(X, V(0))),
            chain(
               assign(s15, V(1.0)),
               loop(i17, [ 0 .. 2 ],
                  chain(
                     assign(s14, mul(s15, nth(D, i17))),
                     assign(s13, add(s13, s14)),
                     assign(s15, mul(s15, s16))
                  )
               )
            )
         ),
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            chain(
               assign(q7, nth(X, add(i15, V(1)))),
               assign(q8, nth(X, add(V(3), i15))),
               assign(w2, sub(q7, q8)),
               assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         )
      ),
      creturn(geq(s9, s13))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   chain(
      chain(
         assign(s16, nth(X, V(0))),
         chain(
            assign(s15, V(1.0)),
            loop(i17, [ 0 .. 2 ],
               chain(
                  assign(s14, mul(s15, nth(D, i17))),
                  assign(s13, add(s13, s14)),
                  assign(s15, mul(s15, s16))
               )
            )
         )
      ),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         chain(
            assign(q7, nth(X, add(i15, V(1)))),
            assign(q8, nth(X, add(V(3), i15))),
            assign(w2, sub(q7, q8)),
            assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      chain(
         assign(s16, nth(X, V(0))),
         chain(
            assign(s15, V(1.0)),
            loop(i17, [ 0 .. 2 ],
               chain(
                  assign(s14, mul(s15, nth(D, i17))),
                  assign(s13, add(s13, s14)),
                  assign(s15, mul(s15, s16))
               )
            )
         )
      ),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         chain(
            assign(q7, nth(X, add(i15, V(1)))),
            assign(q8, nth(X, add(V(3), i15))),
            assign(w2, sub(q7, q8)),
            assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain_xyz
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      chain(
         assign(s16, nth(X, V(0))),
         chain(
            assign(s15, V(1.0)),
            loop(i17, [ 0 .. 2 ],
               chain(
                  assign(s14, mul(s15, nth(D, i17))),
                  assign(s13, add(s13, s14)),
                  assign(s15, mul(s15, s16))
               )
            )
         )
      ),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         chain(
            assign(q7, nth(X, add(i15, V(1)))),
            assign(q8, nth(X, add(V(3), i15))),
            assign(w2, sub(q7, q8)),
            assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      chain(
         assign(s16, nth(X, V(0))),
         chain(
            assign(s15, V(1.0)),
            loop(i17, [ 0 .. 2 ],
               chain(
                  assign(s14, mul(s15, nth(D, i17))),
                  assign(s13, add(s13, s14)),
                  assign(s15, mul(s15, s16))
               )
            )
         )
      ),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         chain(
            assign(q7, nth(X, add(i15, V(1)))),
            assign(q8, nth(X, add(V(3), i15))),
            assign(w2, sub(q7, q8)),
            assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      ),
      creturn(geq(s9, s13))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   chain(
      assign(s16, nth(X, V(0))),
      chain(
         assign(s15, V(1.0)),
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(s14, mul(s15, nth(D, i17))),
               assign(s13, add(s13, s14)),
               assign(s15, mul(s15, s16))
            )
         )
      )
   ),
   assign(s9, V(0.0)),
   loop(i15, [ 0 .. 1 ],
      chain(
         assign(q7, nth(X, add(i15, V(1)))),
         assign(q8, nth(X, add(V(3), i15))),
         assign(w2, sub(q7, q8)),
         assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
         assign(s9, cond(geq(s9, s12), s9, s12))
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      assign(s16, nth(X, V(0))),
      chain(
         assign(s15, V(1.0)),
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(s14, mul(s15, nth(D, i17))),
               assign(s13, add(s13, s14)),
               assign(s15, mul(s15, s16))
            )
         )
      )
   ),
   assign(s9, V(0.0)),
   loop(i15, [ 0 .. 1 ],
      chain(
         assign(q7, nth(X, add(i15, V(1)))),
         assign(q8, nth(X, add(V(3), i15))),
         assign(w2, sub(q7, q8)),
         assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
         assign(s9, cond(geq(s9, s12), s9, s12))
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain_xyz
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      assign(s16, nth(X, V(0))),
      chain(
         assign(s15, V(1.0)),
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(s14, mul(s15, nth(D, i17))),
               assign(s13, add(s13, s14)),
               assign(s15, mul(s15, s16))
            )
         )
      )
   ),
   assign(s9, V(0.0)),
   loop(i15, [ 0 .. 1 ],
      chain(
         assign(q7, nth(X, add(i15, V(1)))),
         assign(q8, nth(X, add(V(3), i15))),
         assign(w2, sub(q7, q8)),
         assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
         assign(s9, cond(geq(s9, s12), s9, s12))
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      assign(s16, nth(X, V(0))),
      chain(
         assign(s15, V(1.0)),
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(s14, mul(s15, nth(D, i17))),
               assign(s13, add(s13, s14)),
               assign(s15, mul(s15, s16))
            )
         )
      ),
      assign(s9, V(0.0))
   ),
   loop(i15, [ 0 .. 1 ],
      chain(
         assign(q7, nth(X, add(i15, V(1)))),
         assign(q8, nth(X, add(V(3), i15))),
         assign(w2, sub(q7, q8)),
         assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
         assign(s9, cond(geq(s9, s12), s9, s12))
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain_xyz
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      assign(s16, nth(X, V(0))),
      chain(
         assign(s15, V(1.0)),
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(s14, mul(s15, nth(D, i17))),
               assign(s13, add(s13, s14)),
               assign(s15, mul(s15, s16))
            )
         )
      ),
      assign(s9, V(0.0))
   ),
   loop(i15, [ 0 .. 1 ],
      chain(
         assign(q7, nth(X, add(i15, V(1)))),
         assign(q8, nth(X, add(V(3), i15))),
         assign(w2, sub(q7, q8)),
         assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
         assign(s9, cond(geq(s9, s12), s9, s12))
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      assign(s16, nth(X, V(0))),
      chain(
         assign(s15, V(1.0)),
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(s14, mul(s15, nth(D, i17))),
               assign(s13, add(s13, s14)),
               assign(s15, mul(s15, s16))
            )
         )
      ),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         chain(
            assign(q7, nth(X, add(i15, V(1)))),
            assign(q8, nth(X, add(V(3), i15))),
            assign(w2, sub(q7, q8)),
            assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain_xyz
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      assign(s16, nth(X, V(0))),
      chain(
         assign(s15, V(1.0)),
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(s14, mul(s15, nth(D, i17))),
               assign(s13, add(s13, s14)),
               assign(s15, mul(s15, s16))
            )
         )
      ),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         chain(
            assign(q7, nth(X, add(i15, V(1)))),
            assign(q8, nth(X, add(V(3), i15))),
            assign(w2, sub(q7, q8)),
            assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      assign(s16, nth(X, V(0))),
      chain(
         assign(s15, V(1.0)),
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(s14, mul(s15, nth(D, i17))),
               assign(s13, add(s13, s14)),
               assign(s15, mul(s15, s16))
            )
         )
      ),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         chain(
            assign(q7, nth(X, add(i15, V(1)))),
            assign(q8, nth(X, add(V(3), i15))),
            assign(w2, sub(q7, q8)),
            assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      ),
      creturn(geq(s9, s13))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   assign(s16, nth(X, V(0))),
   chain(
      assign(s15, V(1.0)),
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(s14, mul(s15, nth(D, i17))),
            assign(s13, add(s13, s14)),
            assign(s15, mul(s15, s16))
         )
      )
   ),
   assign(s9, V(0.0)),
   loop(i15, [ 0 .. 1 ],
      chain(
         assign(q7, nth(X, add(i15, V(1)))),
         assign(q8, nth(X, add(V(3), i15))),
         assign(w2, sub(q7, q8)),
         assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
         assign(s9, cond(geq(s9, s12), s9, s12))
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   chain(
      assign(s16, nth(X, V(0))),
      assign(s15, V(1.0)),
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(s14, mul(s15, nth(D, i17))),
            assign(s13, add(s13, s14)),
            assign(s15, mul(s15, s16))
         )
      )
   ),
   assign(s9, V(0.0)),
   loop(i15, [ 0 .. 1 ],
      chain(
         assign(q7, nth(X, add(i15, V(1)))),
         assign(q8, nth(X, add(V(3), i15))),
         assign(w2, sub(q7, q8)),
         assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
         assign(s9, cond(geq(s9, s12), s9, s12))
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_xyz_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   chain(
      assign(s16, nth(X, V(0))),
      assign(s15, V(1.0)),
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(s14, mul(s15, nth(D, i17))),
            assign(s13, add(s13, s14)),
            assign(s15, mul(s15, s16))
         )
      )
   ),
   assign(s9, V(0.0)),
   loop(i15, [ 0 .. 1 ],
      chain(
         assign(q7, nth(X, add(i15, V(1)))),
         assign(q8, nth(X, add(V(3), i15))),
         assign(w2, sub(q7, q8)),
         assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
         assign(s9, cond(geq(s9, s12), s9, s12))
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      assign(s16, nth(X, V(0))),
      assign(s15, V(1.0)),
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(s14, mul(s15, nth(D, i17))),
            assign(s13, add(s13, s14)),
            assign(s15, mul(s15, s16))
         )
      )
   ),
   assign(s9, V(0.0)),
   loop(i15, [ 0 .. 1 ],
      chain(
         assign(q7, nth(X, add(i15, V(1)))),
         assign(q8, nth(X, add(V(3), i15))),
         assign(w2, sub(q7, q8)),
         assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
         assign(s9, cond(geq(s9, s12), s9, s12))
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain_xyz
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      assign(s16, nth(X, V(0))),
      assign(s15, V(1.0)),
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(s14, mul(s15, nth(D, i17))),
            assign(s13, add(s13, s14)),
            assign(s15, mul(s15, s16))
         )
      )
   ),
   assign(s9, V(0.0)),
   loop(i15, [ 0 .. 1 ],
      chain(
         assign(q7, nth(X, add(i15, V(1)))),
         assign(q8, nth(X, add(V(3), i15))),
         assign(w2, sub(q7, q8)),
         assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
         assign(s9, cond(geq(s9, s12), s9, s12))
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      assign(s16, nth(X, V(0))),
      assign(s15, V(1.0)),
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(s14, mul(s15, nth(D, i17))),
            assign(s13, add(s13, s14)),
            assign(s15, mul(s15, s16))
         )
      ),
      assign(s9, V(0.0))
   ),
   loop(i15, [ 0 .. 1 ],
      chain(
         assign(q7, nth(X, add(i15, V(1)))),
         assign(q8, nth(X, add(V(3), i15))),
         assign(w2, sub(q7, q8)),
         assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
         assign(s9, cond(geq(s9, s12), s9, s12))
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain_xyz
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      assign(s16, nth(X, V(0))),
      assign(s15, V(1.0)),
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(s14, mul(s15, nth(D, i17))),
            assign(s13, add(s13, s14)),
            assign(s15, mul(s15, s16))
         )
      ),
      assign(s9, V(0.0))
   ),
   loop(i15, [ 0 .. 1 ],
      chain(
         assign(q7, nth(X, add(i15, V(1)))),
         assign(q8, nth(X, add(V(3), i15))),
         assign(w2, sub(q7, q8)),
         assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
         assign(s9, cond(geq(s9, s12), s9, s12))
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      assign(s16, nth(X, V(0))),
      assign(s15, V(1.0)),
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(s14, mul(s15, nth(D, i17))),
            assign(s13, add(s13, s14)),
            assign(s15, mul(s15, s16))
         )
      ),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         chain(
            assign(q7, nth(X, add(i15, V(1)))),
            assign(q8, nth(X, add(V(3), i15))),
            assign(w2, sub(q7, q8)),
            assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain_xyz
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      assign(s16, nth(X, V(0))),
      assign(s15, V(1.0)),
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(s14, mul(s15, nth(D, i17))),
            assign(s13, add(s13, s14)),
            assign(s15, mul(s15, s16))
         )
      ),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         chain(
            assign(q7, nth(X, add(i15, V(1)))),
            assign(q8, nth(X, add(V(3), i15))),
            assign(w2, sub(q7, q8)),
            assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      assign(s16, nth(X, V(0))),
      assign(s15, V(1.0)),
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(s14, mul(s15, nth(D, i17))),
            assign(s13, add(s13, s14)),
            assign(s15, mul(s15, s16))
         )
      ),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         chain(
            assign(q7, nth(X, add(i15, V(1)))),
            assign(q8, nth(X, add(V(3), i15))),
            assign(w2, sub(q7, q8)),
            assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      ),
      creturn(geq(s9, s13))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: decl_decl
------------------------------------------------------------------
old expression
------------------------------------------------------------------
decl([ q7, q8, s12, s13, s14, s15, s16, s9 ],
   decl([ w2 ],
      chain(
         chain(
            chain(
               chain(
                  chain(
                     assign(s13, V(0.0)),
                     assign(s16, nth(X, V(0))),
                     assign(s15, V(1.0)),
                     loop(i17, [ 0 .. 2 ],
                        chain(
                           assign(s14, mul(s15, nth(D, i17))),
                           assign(s13, add(s13, s14)),
                           assign(s15, mul(s15, s16))
                        )
                     ),
                     assign(s9, V(0.0)),
                     loop(i15, [ 0 .. 1 ],
                        chain(
                           assign(q7, nth(X, add(i15, V(1)))),
                           assign(q8, nth(X, add(V(3), i15))),
                           assign(w2, sub(q7, q8)),
                           assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                           assign(s9, cond(geq(s9, s12), s9, s12))
                        )
                     ),
                     creturn(geq(s9, s13))
                  )
               )
            )
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
decl([ q7, q8, s12, s13, s14, s15, s16, s9, w2 ],
   chain(
      chain(
         chain(
            chain(
               chain(
                  assign(s13, V(0.0)),
                  assign(s16, nth(X, V(0))),
                  assign(s15, V(1.0)),
                  loop(i17, [ 0 .. 2 ],
                     chain(
                        assign(s14, mul(s15, nth(D, i17))),
                        assign(s13, add(s13, s14)),
                        assign(s15, mul(s15, s16))
                     )
                  ),
                  assign(s9, V(0.0)),
                  loop(i15, [ 0 .. 1 ],
                     chain(
                        assign(q7, nth(X, add(i15, V(1)))),
                        assign(q8, nth(X, add(V(3), i15))),
                        assign(w2, sub(q7, q8)),
                        assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                        assign(s9, cond(geq(s9, s12), s9, s12))
                     )
                  ),
                  creturn(geq(s9, s13))
               )
            )
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      chain(
         chain(
            chain(
               assign(s13, V(0.0)),
               assign(s16, nth(X, V(0))),
               assign(s15, V(1.0)),
               loop(i17, [ 0 .. 2 ],
                  chain(
                     assign(s14, mul(s15, nth(D, i17))),
                     assign(s13, add(s13, s14)),
                     assign(s15, mul(s15, s16))
                  )
               ),
               assign(s9, V(0.0)),
               loop(i15, [ 0 .. 1 ],
                  chain(
                     assign(q7, nth(X, add(i15, V(1)))),
                     assign(q8, nth(X, add(V(3), i15))),
                     assign(w2, sub(q7, q8)),
                     assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                     assign(s9, cond(geq(s9, s12), s9, s12))
                  )
               ),
               creturn(geq(s9, s13))
            )
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      chain(
         chain(
            assign(s13, V(0.0)),
            assign(s16, nth(X, V(0))),
            assign(s15, V(1.0)),
            loop(i17, [ 0 .. 2 ],
               chain(
                  assign(s14, mul(s15, nth(D, i17))),
                  assign(s13, add(s13, s14)),
                  assign(s15, mul(s15, s16))
               )
            ),
            assign(s9, V(0.0)),
            loop(i15, [ 0 .. 1 ],
               chain(
                  assign(q7, nth(X, add(i15, V(1)))),
                  assign(q8, nth(X, add(V(3), i15))),
                  assign(w2, sub(q7, q8)),
                  assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            ),
            creturn(geq(s9, s13))
         )
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      chain(
         chain(
            assign(s13, V(0.0)),
            assign(s16, nth(X, V(0))),
            assign(s15, V(1.0)),
            loop(i17, [ 0 .. 2 ],
               chain(
                  assign(s14, mul(s15, nth(D, i17))),
                  assign(s13, add(s13, s14)),
                  assign(s15, mul(s15, s16))
               )
            ),
            assign(s9, V(0.0)),
            loop(i15, [ 0 .. 1 ],
               chain(
                  assign(q7, nth(X, add(i15, V(1)))),
                  assign(q8, nth(X, add(V(3), i15))),
                  assign(w2, sub(q7, q8)),
                  assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                  assign(s9, cond(geq(s9, s12), s9, s12))
               )
            ),
            creturn(geq(s9, s13))
         )
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      chain(
         assign(s13, V(0.0)),
         assign(s16, nth(X, V(0))),
         assign(s15, V(1.0)),
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(s14, mul(s15, nth(D, i17))),
               assign(s13, add(s13, s14)),
               assign(s15, mul(s15, s16))
            )
         ),
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            chain(
               assign(q7, nth(X, add(i15, V(1)))),
               assign(q8, nth(X, add(V(3), i15))),
               assign(w2, sub(q7, q8)),
               assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         ),
         creturn(geq(s9, s13))
      )
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      chain(
         assign(s13, V(0.0)),
         assign(s16, nth(X, V(0))),
         assign(s15, V(1.0)),
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(s14, mul(s15, nth(D, i17))),
               assign(s13, add(s13, s14)),
               assign(s15, mul(s15, s16))
            )
         ),
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            chain(
               assign(q7, nth(X, add(i15, V(1)))),
               assign(q8, nth(X, add(V(3), i15))),
               assign(w2, sub(q7, q8)),
               assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         ),
         creturn(geq(s9, s13))
      )
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      assign(s16, nth(X, V(0))),
      assign(s15, V(1.0)),
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(s14, mul(s15, nth(D, i17))),
            assign(s13, add(s13, s14)),
            assign(s15, mul(s15, s16))
         )
      ),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         chain(
            assign(q7, nth(X, add(i15, V(1)))),
            assign(q8, nth(X, add(V(3), i15))),
            assign(w2, sub(q7, q8)),
            assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      ),
      creturn(geq(s9, s13))
   )
)
------------------------------------------------------------------

------------------------------------------------------------------
RULE: chain_chain
------------------------------------------------------------------
old expression
------------------------------------------------------------------
chain(
   chain(
      assign(s13, V(0.0)),
      assign(s16, nth(X, V(0))),
      assign(s15, V(1.0)),
      loop(i17, [ 0 .. 2 ],
         chain(
            assign(s14, mul(s15, nth(D, i17))),
            assign(s13, add(s13, s14)),
            assign(s15, mul(s15, s16))
         )
      ),
      assign(s9, V(0.0)),
      loop(i15, [ 0 .. 1 ],
         chain(
            assign(q7, nth(X, add(i15, V(1)))),
            assign(q8, nth(X, add(V(3), i15))),
            assign(w2, sub(q7, q8)),
            assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
            assign(s9, cond(geq(s9, s12), s9, s12))
         )
      ),
      creturn(geq(s9, s13))
   )
)
------------------------------------------------------------------
new expression
------------------------------------------------------------------
chain(
   assign(s13, V(0.0)),
   assign(s16, nth(X, V(0))),
   assign(s15, V(1.0)),
   loop(i17, [ 0 .. 2 ],
      chain(
         assign(s14, mul(s15, nth(D, i17))),
         assign(s13, add(s13, s14)),
         assign(s15, mul(s15, s16))
      )
   ),
   assign(s9, V(0.0)),
   loop(i15, [ 0 .. 1 ],
      chain(
         assign(q7, nth(X, add(i15, V(1)))),
         assign(q8, nth(X, add(V(3), i15))),
         assign(w2, sub(q7, q8)),
         assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
         assign(s9, cond(geq(s9, s12), s9, s12))
      )
   ),
   creturn(geq(s9, s13))
)
------------------------------------------------------------------

******************************************************************
END PROOF: iCode -> iCode
------------------------------------------------------------------
Final iCode
------------------------------------------------------------------
func(TInt, "transform", [ X, D ], 
   decl([ q7, q8, s12, s13, s14, s15, s16, s9, w2 ],
      chain(
         assign(s13, V(0.0)),
         assign(s16, nth(X, V(0))),
         assign(s15, V(1.0)),
         loop(i17, [ 0 .. 2 ],
            chain(
               assign(s14, mul(s15, nth(D, i17))),
               assign(s13, add(s13, s14)),
               assign(s15, mul(s15, s16))
            )
         ),
         assign(s9, V(0.0)),
         loop(i15, [ 0 .. 1 ],
            chain(
               assign(q7, nth(X, add(i15, V(1)))),
               assign(q8, nth(X, add(V(3), i15))),
               assign(w2, sub(q7, q8)),
               assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
               assign(s9, cond(geq(s9, s12), s9, s12))
            )
         ),
         creturn(geq(s9, s13))
      )
   )
)
******************************************************************

rec(
  opts := <HACMS options, DoubleMixin>,
  rt := TLess_Base( TLess(TEvalPolynomial(2, D), TDistance(TInfinityNorm(2))),
      TEvalPolynomial_Base( TEvalPolynomial(2, D) ),
      TDistance_Base( TDistance(TInfinityNorm(2)),
        TInfinityNorm_Base( TInfinityNorm(2) ) ) ),
  s := BinOp(1, Lambda([ r14, r15 ], geq(r15, r14))) o 
    DirectSum(
      ScalarProd(3, D) o 
      Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)), 
      Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
      PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
      BinOp(2, Lambda([ r12, r13 ], sub(r12, r13)))
    ),
  ss := BinOp(1, Lambda([ r14, r15 ], geq(r15, r14))) o 
    SUMUnion(
      ScatHUnion(2, 1, 0, 1) o 
      Reduction(3, (a, b) -> add(a, b), V(0.0), (arg) -> false) o 
      PointWise(3, Lambda([ r16, i14 ], mul(r16, nth(D, i14)))) o 
      Induction(3, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
      GathH(5, 1, 0, 1), 
      ScatHUnion(2, 1, 1, 1) o 
      Reduction(2, (a, b) -> max(a, b), V(0.0), (arg) -> false) o 
      PointWise(2, Lambda([ r11, i13 ], abs(r11))) o 
      ISumUnion(i15, 2,
        ScatHUnion(2, 1, i15, 1) o 
        BinOp(1, Lambda([ r12, r13 ], sub(r12, r13))) o 
        GathH(4, 2, i15, 2)
      ) o 
      GathH(5, 4, 1, 1)
    ),
  ss2 := BinOp(1, Lambda([ r14, r15 ], geq(r15, r14))) o 
    SUMUnion(
      eUnion(2, 0) o 
      ISumReduction(i17, 3, (a, b) -> add(a, b), V(0.0), (arg) -> false,
        PointWise(1, Lambda([ r16, i19 ], mul(r16, nth(D, i17)))) o 
        Inductor(3, i17, Lambda([ r9, r10 ], mul(r9, r10)), V(1.0)) o 
        eT(5, 0)
      ), 
      eUnion(2, 1) o 
      ISumReduction(i15, 2, (a, b) -> max(a, b), V(0.0), (arg) -> false,
        BinOp(1, Lambda([ r12, r13 ], abs(sub(r12, r13)))) o 
        ISumUnion(i18, 2,
          eUnion(2, i18) o 
          eT(5, add(add(i15, V(1)), mul(V(2), i18)))
        )
      )
    ),
  c := func(TInt, "transform", [ X, D ], 
       decl([ T10 ],
          chain(
             chain(
                decl([ T11 ],
                   chain(
                      chain(
                         assign(nth(T11, V(0)), V(0.0)),
                         loop(i17, [ 0 .. 2 ],
                            decl([ T12 ],
                               chain(
                                  decl([ T13, T14 ],
                                     chain(
                                        assign(nth(T14, V(0)), nth(X, V(0))),
                                        assign(nth(T13, V(0)), cond(eq(i17, V(0)), V(1.0), mul(nth(T13, V(0)), nth(T14, V(0))))),
                                        assign(nth(T12, V(0)), mul(nth(T13, V(0)), nth(D, i17)))
                                     )
                                  ),
                                  assign(nth(T11, V(0)), add(nth(T11, V(0)), nth(T12, V(0))))
                               )
                            )
                         )
                      ),
                      assign(nth(T10, V(0)), nth(T11, V(0)))
                   )
                ),
                decl([ T15 ],
                   chain(
                      chain(
                         assign(nth(T15, V(0)), V(0.0)),
                         loop(i15, [ 0 .. 1 ],
                            decl([ T16 ],
                               chain(
                                  decl([ T17 ],
                                     chain(
                                        loop(i18, [ 0 .. 1 ],
                                           decl([ T18 ],
                                              chain(
                                                 assign(nth(T18, V(0)), nth(X, add(add(i15, V(1)), mul(V(2), i18)))),
                                                 assign(nth(T17, i18), nth(T18, V(0)))
                                              )
                                           )
                                        ),
                                        assign(nth(T16, V(0)), abs(sub(nth(T17, V(0)), nth(T17, V(1)))))
                                     )
                                  ),
                                  assign(nth(T15, V(0)), max(nth(T16, V(0)), nth(T15, V(0))))
                               )
                            )
                         )
                      ),
                      assign(nth(T10, V(1)), nth(T15, V(0)))
                   )
                )
             ),
             assign(nth(Y, V(0)), geq(nth(T10, V(1)), nth(T10, V(0))))
          )
       )
    ),
  c2 := func(TInt, "transform", [ X, D ], 
       decl([ q7, q8, s12, s13, s14, s15, s16, s9, w2 ],
          chain(
             assign(s13, V(0.0)),
             assign(s16, nth(X, V(0))),
             assign(s15, V(1.0)),
             loop(i17, [ 0 .. 2 ],
                chain(
                   assign(s14, mul(s15, nth(D, i17))),
                   assign(s13, add(s13, s14)),
                   assign(s15, mul(s15, s16))
                )
             ),
             assign(s9, V(0.0)),
             loop(i15, [ 0 .. 1 ],
                chain(
                   assign(q7, nth(X, add(i15, V(1)))),
                   assign(q8, nth(X, add(V(3), i15))),
                   assign(w2, sub(q7, q8)),
                   assign(s12, cond(geq(w2, V(0)), w2, neg(w2))),
                   assign(s9, cond(geq(s9, s12), s9, s12))
                )
             ),
             creturn(geq(s9, s13))
          )
       )
    ) )